****************************************************************************************
*****Replication file for Knutsen & Rasmussen (2017), Comparative Political Studies*****
****************************************************************************************


set more off, permanently
set matsize 5000, permanently
**Alter path directory
use "C:\Users\carlhk_adm\Dropbox\when labour gets what it whants\database\CPS_replication_Final", clear 

sort Ccodecow year
xtset Ccodecow year
keep Ccodecow country year oldage_yearlaw mater_yearlaw sick_yearlaw unemp_yearlaw working_yearlaw familiy_yearlaw universalism_all univers_oldageprog univers_mater_prog univers_sick_prog univers_working_prog univers_unemp_prog univers_familiy_prog boix_regime democracy chga_demo comm polity_2 Total_Resources_Income_PC agro literacy Britcolony Civil_War loggdp region lnpop al_ethnic urban cow_milsize resdep2 exports imports gwf_fail wr_regtype wr_nonautocracy loggwfdur yearx


**************************
****Creating variables****
**************************



generate invyear = 2012-year
sort Ccodecow invyear
ssc install carryforward
bysort Ccodecow: carryforward al_ethnic, gen(EFI_long)
sort Ccodecow year
summarize al_ethnic EFI_long lnpop loggdp

**generate trade variables
generate expo= exports
replace expo=. if exports==-9
generate impo= imports
replace impo=. if imports==-9
generate totaltrade = impo+expo
generate totalgdp = (exp(loggdp))*(exp(lnpop))
summarize totaltrade totalgdp, detail
generate tottrade =totaltrade*1000
summarize tottrade totalgdp
generate tradeshare = tottrade/totalgdp
summarize tradeshar, detail

bysort Ccodecow: generate lagoldage_yearlaw = oldage_yearlaw[_n-1]
sort Ccodecow year
generate introoldage = oldage_yearlaw - lagoldage_yearlaw if oldage_yearlaw !=. & lagoldage_yearlaw!=.
tabulate introoldage
generate introoldager = introoldage
replace introoldager = 0 if introoldage==-1

bysort Ccodecow: generate lagmater_yearlaw = mater_yearlaw[_n-1]
sort Ccodecow year
generate intromater = mater_yearlaw - lagmater_yearlaw if mater_yearlaw !=. & lagmater_yearlaw!=.
tabulate intromater
generate intromaterr = intromater
replace intromaterr = 0 if intromater==-1

bysort Ccodecow: generate lagsick_yearlaw = sick_yearlaw[_n-1]
sort Ccodecow year
generate introsick = sick_yearlaw - lagsick_yearlaw if sick_yearlaw !=. & lagsick_yearlaw!=.
tabulate introsick
generate introsickr = introsick
replace introsickr = 0 if introsick==-1

bysort Ccodecow: generate lagunemp_yearlaw = unemp_yearlaw[_n-1]
sort Ccodecow year
generate introunemp = unemp_yearlaw - lagunemp_yearlaw if unemp_yearlaw !=. & lagunemp_yearlaw!=.
tabulate introunemp
generate introunempr = introunemp
replace introunempr = 0 if introunemp==-1

bysort Ccodecow: generate lagworking_yearlaw = working_yearlaw[_n-1]
sort Ccodecow year
generate introworking = working_yearlaw - lagworking_yearlaw if working_yearlaw !=. & lagworking_yearlaw!=.
tabulate introworking
generate introworkingr = introworking
replace introworkingr = 0 if introworking==-1

bysort Ccodecow: generate lagfamiliy_yearlaw = familiy_yearlaw[_n-1]
sort Ccodecow year
generate introfamiliy = familiy_yearlaw - lagfamiliy_yearlaw if familiy_yearlaw !=. & lagfamiliy_yearlaw!=.
tabulate introfamiliy
generate introfamiliyr = introfamiliy
replace introfamiliyr = 0 if introfamiliy==-1

generate univpension3=.
replace univpension3 =0 if univers_oldageprog!=.
replace univpension3=1 if univers_oldageprog>2

generate univpension4=.
replace univpension4 =0 if univers_oldageprog!=.
replace univpension4=1 if univers_oldageprog>3


generate univpension5 =.
replace univpension5 =0 if univers_oldageprog!=.
replace univpension5=1 if univers_oldageprog>4

generate univpension6 =.
replace univpension6 =0 if univers_oldageprog!=.
replace univpension6=1 if univers_oldageprog>5

generate univpension7 =.
replace univpension7 =0 if univers_oldageprog!=.
replace univpension7=1 if univers_oldageprog>6

generate univpension8 =.
replace univpension8 =0 if univers_oldageprog!=.
replace univpension8=1 if univers_oldageprog>7

generate univpension9 =.
replace univpension9 =0 if univers_oldageprog!=.
replace univpension9=1 if univers_oldageprog>8

generate gwf_party =.
replace gwf_party = 0 if wr_regtype !=. | wr_nonautocracy!=.
replace gwf_party = 1 if wr_regtype == 6 | wr_regtype == 7 | wr_regtype == 8 | wr_regtype == 9 

generate gwf_military =.
replace gwf_military = 0 if wr_regtype !=. | wr_nonautocracy!=.
replace gwf_military = 1 if wr_regtype == 1 | wr_regtype == 2 | wr_regtype == 3

generate gwf_monarchy =.
replace gwf_monarchy = 0 if wr_regtype !=. | wr_nonautocracy!=.
replace gwf_monarchy = 1 if wr_regtype ==4

generate gwf_personal =.
replace gwf_personal = 0 if wr_regtype !=. | wr_nonautocracy!=.
replace gwf_personal = 1 if wr_regtype ==10

generate gwf_other = .
replace gwf_other = 0 if wr_regtype !=. | wr_nonautocracy!=.
replace gwf_other = 1 if wr_regtype ==5 | wr_nonautocracy==2 | wr_nonautocracy==3| wr_nonautocracy==4| wr_nonautocracy==5| wr_nonautocracy==6

generate gwf_democracy = .
replace gwf_democracy = 0 if wr_regtype !=. | wr_nonautocracy!=.
replace gwf_democracy = 1 if wr_nonautocracy==1

**generate alternative regime dummies; more strict definition of party regimes		
generate gwf_partystrict =.
replace gwf_partystrict = 0 if wr_regtype !=. | wr_nonautocracy!=.
replace gwf_partystrict = 1 if wr_regtype == 6 

generate gwf_partyhybrid =.
replace gwf_partyhybrid = 0 if wr_regtype !=. | wr_nonautocracy!=.
replace gwf_partyhybrid = 1 if wr_regtype == 7 | wr_regtype == 8 | wr_regtype == 9 

**generate alternative dummy for other regimes, only including non-autocracies
generate gwf_otherna = .
replace gwf_otherna = 0 if wr_regtype !=. | wr_nonautocracy!=.
replace gwf_otherna = 1 if wr_nonautocracy==2 | wr_nonautocracy==3| wr_nonautocracy==4| wr_nonautocracy==5| wr_nonautocracy==6

generate democratizationBMR = .
replace democratizationBMR=1 if (boix_regime-l.boix_regime)==1 & l.boix_regime==0
replace democratizationBMR=0 if boix_regime==0 & l.boix_regime==0 

by Ccodecow, sort: generate leaddemocracy = gwf_democracy[_n+1]
sort Ccodecow year
generate democratization_gwf=.
replace democratization_gwf=1 if wr_regtype!=. & leaddemocracy==1
replace democratization_gwf=0 if wr_regtype!=. & leaddemocracy==0

generate yearb=year

**generate INSTRUMENTS for old-age pensions; 

**First: avg number of countries in region (adjusted to exclude country in question) that have oldagepension system

egen reg1=sum(oldage_yearlaw) if  region==1 & oldage_yearlaw!=., by (year)
egen re1 = sum(region) if  region==1 & oldage_yearlaw!=., by (year)
generate r1 = (reg1-oldage_yearlaw)/(re1-1)

summarize r1, detail
summarize oldage_yearlaw if region==1, detail

egen reg2=sum(oldage_yearlaw) if  region==2 & oldage_yearlaw!=., by (year)
egen ret2 = sum(region) if  region==2 & oldage_yearlaw!=., by (year)
generate re2 =ret2/2
generate r2 = (reg2-oldage_yearlaw)/(re2-1)

egen reg3=sum(oldage_yearlaw) if  region==3 & oldage_yearlaw!=., by (year)
egen ret3 = sum(region) if  region==3 & oldage_yearlaw!=., by (year)
generate re3 =ret3/3
generate r3 = (reg3-oldage_yearlaw)/(re3-1)

egen reg4=sum(oldage_yearlaw) if  region==4 & oldage_yearlaw!=., by (year)
egen ret4 = sum(region) if  region==4 & oldage_yearlaw!=., by (year)
generate re4 =ret4/4
generate r4 = (reg4-oldage_yearlaw)/(re4-1)

egen reg5=sum(oldage_yearlaw) if  region==5 & oldage_yearlaw!=., by (year)
egen ret5 = sum(region) if  region==5 & oldage_yearlaw!=., by (year)
generate re5 =ret5/5
generate r5 = (reg5-oldage_yearlaw)/(re5-1)

egen reg6=sum(oldage_yearlaw) if  region==6 & oldage_yearlaw!=., by (year)
egen ret6 = sum(region) if  region==6 & oldage_yearlaw!=., by (year)
generate re6 =ret6/6
generate r6 = (reg6-oldage_yearlaw)/(re6-1)

egen reg7=sum(oldage_yearlaw) if  region==7 & oldage_yearlaw!=., by (year)
egen ret7 = sum(region) if  region==7 & oldage_yearlaw!=., by (year)
generate re7 =ret7/7
generate r7 = (reg7-oldage_yearlaw)/(re7-1)

egen reg8=sum(oldage_yearlaw) if  region==8 & oldage_yearlaw!=., by (year)
egen ret8 = sum(region) if  region==8 & oldage_yearlaw!=., by (year)
generate re8 =ret8/8
generate r8 = (reg8-oldage_yearlaw)/(re8-1)

generate region_pension = r1
replace region_pension = r2 if region_pension==.
replace region_pension = r3 if region_pension==.
replace region_pension = r4 if region_pension==.
replace region_pension = r5 if region_pension==.
replace region_pension = r6 if region_pension==.
replace region_pension = r7 if region_pension==.
replace region_pension = r8 if region_pension==.


summarize r1 r2 r3 r4 r5 r6 r7 r8 region_pension

**Second: Avg number of countries globally, excluding the country in question, that have pension

egen glob =sum(oldage_yearlaw) if oldage_yearlaw!=., by (year)
generate dummysample = 1 if oldage_yearlaw!=.
egen globsamp =sum(dummysample), by (year)
generate global_pension = (glob-oldage_yearlaw)/(globsamp-1) 
summarize global_pension globsamp


**Generate regional control for avg regime failure in region

egen regf1=sum(gwf_fail) if  region==1 & gwf_fail!=., by (year)
egen ref1 = sum(region) if  region==1 & gwf_fail!=., by (year)
generate rf1 = (regf1-gwf_fail)/(ref1-1)

summarize r1, detail
summarize oldage_yearlaw if region==1, detail

egen regf2=sum(gwf_fail) if  region==2 & gwf_fail!=., by (year)
egen retf2 = sum(region) if  region==2 & gwf_fail!=., by (year)
generate ref2 =retf2/2
generate rf2 = (regf2-gwf_fail)/(ref2-1)

egen regf3=sum(gwf_fail) if  region==3 & gwf_fail!=., by (year)
egen retf3 = sum(region) if  region==3 & gwf_fail!=., by (year)
generate ref3 =retf3/3
generate rf3 = (regf3-gwf_fail)/(ref3-1)

egen regf4=sum(gwf_fail) if  region==4 & gwf_fail!=., by (year)
egen retf4 = sum(region) if  region==4 & gwf_fail!=., by (year)
generate ref4 =retf4/4
generate rf4 = (regf4-gwf_fail)/(ref4-1)

egen regf5=sum(gwf_fail) if  region==5 & gwf_fail!=., by (year)
egen retf5 = sum(region) if  region==5 & gwf_fail!=., by (year)
generate ref5 =retf5/5
generate rf5 = (regf5-gwf_fail)/(ref5-1)

egen regf6=sum(gwf_fail) if  region==6 & gwf_fail!=., by (year)
egen retf6 = sum(region) if  region==6 & gwf_fail!=., by (year)
generate ref6 =retf6/6
generate rf6 = (regf6-gwf_fail)/(ref6-1)

egen regf7=sum(gwf_fail) if  region==7 & gwf_fail!=., by (year)
egen retf7 = sum(region) if  region==7 & gwf_fail!=., by (year)
generate ref7 =retf7/7
generate rf7 = (regf7-gwf_fail)/(ref7-1)

egen regf8=sum(gwf_fail) if  region==8 & gwf_fail!=., by (year)
egen retf8 = sum(region) if  region==8 & gwf_fail!=., by (year)
generate ref8 =retf8/8
generate rf8 = (regf8-gwf_fail)/(ref8-1)

generate region_fail = rf1
replace region_fail = rf2 if region_fail==.
replace region_fail = rf3 if region_fail==.
replace region_fail = rf4 if region_fail==.
replace region_fail = rf5 if region_fail==.
replace region_fail = rf6 if region_fail==.
replace region_fail = rf7 if region_fail==.
replace region_fail = rf8 if region_fail==.


summarize rf1 rf2 rf3 rf4 rf5 rf6 rf7 rf8 region_fail

egen globf =sum(gwf_fail) if gwf_fail!=., by (year)
generate dummysamplef = 1 if gwf_fail!=.
egen globsampf =sum(dummysamplef), by (year)
generate global_fail = (globf-gwf_fail)/(globsampf-1) 
summarize global_fail globsampf


**generate INSTRUMENTS; maternity

egen seg1=sum(mater_yearlaw) if  region==1 & mater_yearlaw!=., by (year)
egen se1 = sum(region) if  region==1 & mater_yearlaw!=., by (year)
generate s1 = (seg1-mater_yearlaw)/(se1-1)

summarize s1, detail
summarize mater_yearlaw if region==1, detail

egen seg2=sum(mater_yearlaw) if  region==2 & mater_yearlaw!=., by (year)
egen set2 = sum(region) if  region==2 & mater_yearlaw!=., by (year)
generate se2 =set2/2
generate s2 = (seg2-mater_yearlaw)/(se2-1)

egen seg3=sum(mater_yearlaw) if  region==3 & mater_yearlaw!=., by (year)
egen set3 = sum(region) if  region==3 & mater_yearlaw!=., by (year)
generate se3 =set3/3
generate s3 = (seg3-mater_yearlaw)/(se3-1)

egen seg4=sum(mater_yearlaw) if  region==4 & mater_yearlaw!=., by (year)
egen set4 = sum(region) if  region==4 & mater_yearlaw!=., by (year)
generate se4 =set4/4
generate s4 = (seg4-mater_yearlaw)/(se4-1)

egen seg5=sum(mater_yearlaw) if  region==5 & mater_yearlaw!=., by (year)
egen set5 = sum(region) if  region==5 & mater_yearlaw!=., by (year)
generate se5 =set5/5
generate s5 = (seg5-mater_yearlaw)/(se5-1)

egen seg6=sum(mater_yearlaw) if  region==6 & mater_yearlaw!=., by (year)
egen set6 = sum(region) if  region==6 & mater_yearlaw!=., by (year)
generate se6 =set6/6
generate s6 = (seg6-mater_yearlaw)/(se6-1)

egen seg7=sum(mater_yearlaw) if  region==7 & mater_yearlaw!=., by (year)
egen set7 = sum(region) if  region==7 & mater_yearlaw!=., by (year)
generate se7 =set7/7
generate s7 = (seg7-mater_yearlaw)/(se7-1)

egen seg8=sum(mater_yearlaw) if  region==8 & mater_yearlaw!=., by (year)
egen set8 = sum(region) if  region==8 & mater_yearlaw!=., by (year)
generate se8 =set8/8
generate s8 = (seg8-mater_yearlaw)/(se8-1)

generate region_mater = s1
replace region_mater = s2 if region_mater==.
replace region_mater = s3 if region_mater==.
replace region_mater = s4 if region_mater==.
replace region_mater = s5 if region_mater==.
replace region_mater = s6 if region_mater==.
replace region_mater = s7 if region_mater==.
replace region_mater = s8 if region_mater==.


summarize s1 s2 s3 s4 s5 s6 s7 s8 region_mater

**Second: Avg number of countries globally, excluding the country in question, that have maternity program

egen glob2 =sum(mater_yearlaw) if mater_yearlaw!=., by (year)
generate dummysample2 = 1 if mater_yearlaw!=.
egen globsamp2 =sum(dummysample2), by (year)
generate global_mater = (glob2-mater_yearlaw)/(globsamp2-1) 
summarize global_mater globsamp2


**Instruments family allowances

egen sseg1=sum(familiy_yearlaw) if  region==1 & familiy_yearlaw!=., by (year)
egen sse1 = sum(region) if  region==1 & familiy_yearlaw!=., by (year)
generate ss1 = (sseg1-familiy_yearlaw)/(sse1-1)

summarize ss1, detail
summarize familiy_yearlaw if region==1, detail

egen sseg2=sum(familiy_yearlaw) if  region==2 & familiy_yearlaw!=., by (year)
egen sset2 = sum(region) if  region==2 & familiy_yearlaw!=., by (year)
generate sse2 =sset2/2
generate ss2 = (sseg2-familiy_yearlaw)/(sse2-1)

egen sseg3=sum(familiy_yearlaw) if  region==3 & familiy_yearlaw!=., by (year)
egen sset3 = sum(region) if  region==3 & familiy_yearlaw!=., by (year)
generate sse3 =sset3/3
generate ss3 = (sseg3-familiy_yearlaw)/(sse3-1)

egen sseg4=sum(familiy_yearlaw) if  region==4 & familiy_yearlaw!=., by (year)
egen sset4 = sum(region) if  region==4 & familiy_yearlaw!=., by (year)
generate sse4 =sset4/4
generate ss4 = (sseg4-familiy_yearlaw)/(sse4-1)

egen sseg5=sum(familiy_yearlaw) if  region==5 & familiy_yearlaw!=., by (year)
egen sset5 = sum(region) if  region==5 & familiy_yearlaw!=., by (year)
generate sse5 =sset5/5
generate ss5 = (sseg5-familiy_yearlaw)/(sse5-1)

egen sseg6=sum(familiy_yearlaw) if  region==6 & familiy_yearlaw!=., by (year)
egen sset6 = sum(region) if  region==6 & familiy_yearlaw!=., by (year)
generate sse6 =sset6/6
generate ss6 = (sseg6-familiy_yearlaw)/(sse6-1)

egen sseg7=sum(familiy_yearlaw) if  region==7 & familiy_yearlaw!=., by (year)
egen sset7 = sum(region) if  region==7 & familiy_yearlaw!=., by (year)
generate sse7 =sset7/7
generate ss7 = (sseg7-familiy_yearlaw)/(sse7-1)

egen sseg8=sum(familiy_yearlaw) if  region==8 & familiy_yearlaw!=., by (year)
egen sset8 = sum(region) if  region==8 & familiy_yearlaw!=., by (year)
generate sse8 =sset8/8
generate ss8 = (sseg8-familiy_yearlaw)/(sse8-1)

generate region_familiy = ss1
replace region_familiy = ss2 if region_familiy==.
replace region_familiy = ss3 if region_familiy==.
replace region_familiy = ss4 if region_familiy==.
replace region_familiy = ss5 if region_familiy==.
replace region_familiy = ss6 if region_familiy==.
replace region_familiy = ss7 if region_familiy==.
replace region_familiy = ss8 if region_familiy==.


summarize s1 s2 s3 s4 s5 s6 s7 s8 region_familiy

**Second: Avg number of countries globally, excluding the country in question, that have family allowance program

egen glob3 =sum(familiy_yearlaw) if familiy_yearlaw!=., by (year)
generate dummysample3 = 1 if familiy_yearlaw!=.
egen globsamp3 =sum(dummysample3), by (year)
generate global_familiy = (glob3-familiy_yearlaw)/(globsamp3-1) 
summarize global_familiy globsamp3




**Generate IVs also for sick_yearlaw unemp_yearlaw working_yearlaw

***SICKNESS
egen ssseg1=sum(sick_yearlaw) if  region==1 & sick_yearlaw!=., by (year)
egen ssse1 = sum(region) if  region==1 & sick_yearlaw!=., by (year)
generate sss1 = (ssseg1-sick_yearlaw)/(ssse1-1)

summarize sss1, detail
summarize sick_yearlaw if region==1, detail

egen ssseg2=sum(sick_yearlaw) if  region==2 & sick_yearlaw!=., by (year)
egen ssset2 = sum(region) if  region==2 & sick_yearlaw!=., by (year)
generate ssse2 =ssset2/2
generate sss2 = (ssseg2-sick_yearlaw)/(ssse2-1)

egen ssseg3=sum(sick_yearlaw) if  region==3 & sick_yearlaw!=., by (year)
egen ssset3 = sum(region) if  region==3 & sick_yearlaw!=., by (year)
generate ssse3 =ssset3/3
generate sss3 = (ssseg3-sick_yearlaw)/(ssse3-1)

egen ssseg4=sum(sick_yearlaw) if  region==4 & sick_yearlaw!=., by (year)
egen ssset4 = sum(region) if  region==4 & sick_yearlaw!=., by (year)
generate ssse4 =ssset4/4
generate sss4 = (ssseg4-sick_yearlaw)/(ssse4-1)

egen ssseg5=sum(sick_yearlaw) if  region==5 & sick_yearlaw!=., by (year)
egen ssset5 = sum(region) if  region==5 & sick_yearlaw!=., by (year)
generate ssse5 =ssset5/5
generate sss5 = (ssseg5-sick_yearlaw)/(ssse5-1)

egen ssseg6=sum(sick_yearlaw) if  region==6 & sick_yearlaw!=., by (year)
egen ssset6 = sum(region) if  region==6 & sick_yearlaw!=., by (year)
generate ssse6 =ssset6/6
generate sss6 = (ssseg6-sick_yearlaw)/(ssse6-1)

egen ssseg7=sum(sick_yearlaw) if  region==7 & sick_yearlaw!=., by (year)
egen ssset7 = sum(region) if  region==7 & sick_yearlaw!=., by (year)
generate ssse7 =ssset7/7
generate sss7 = (ssseg7-sick_yearlaw)/(ssse7-1)

egen ssseg8=sum(sick_yearlaw) if  region==8 & sick_yearlaw!=., by (year)
egen ssset8 = sum(region) if  region==8 & sick_yearlaw!=., by (year)
generate ssse8 =ssset8/8
generate sss8 = (ssseg8-sick_yearlaw)/(ssse8-1)

generate region_sick = sss1
replace region_sick = sss2 if region_sick==.
replace region_sick = sss3 if region_sick==.
replace region_sick = sss4 if region_sick==.
replace region_sick = sss5 if region_sick==.
replace region_sick = sss6 if region_sick==.
replace region_sick = sss7 if region_sick==.
replace region_sick = sss8 if region_sick==.


summarize s1 s2 s3 s4 s5 s6 s7 s8 region_sick

**Second: Avg number of countries globally, excluding the country in question, that have sick

egen glob4 =sum(sick_yearlaw) if sick_yearlaw!=., by (year)
generate dummysample4 = 1 if sick_yearlaw!=.
egen globsamp4 =sum(dummysample4), by (year)
generate global_sick = (glob4-sick_yearlaw)/(globsamp4-1) 
summarize global_sick globsamp4

**UNEMPLOYMENT

egen sssseg1=sum(unemp_yearlaw) if  region==1 & unemp_yearlaw!=., by (year)
egen sssse1 = sum(region) if  region==1 & unemp_yearlaw!=., by (year)
generate ssss1 = (sssseg1-unemp_yearlaw)/(sssse1-1)

summarize ssss1, detail
summarize unemp_yearlaw if region==1, detail

egen sssseg2=sum(unemp_yearlaw) if  region==2 & unemp_yearlaw!=., by (year)
egen sssset2 = sum(region) if  region==2 & unemp_yearlaw!=., by (year)
generate sssse2 =sssset2/2
generate ssss2 = (sssseg2-unemp_yearlaw)/(sssse2-1)

egen sssseg3=sum(unemp_yearlaw) if  region==3 & unemp_yearlaw!=., by (year)
egen sssset3 = sum(region) if  region==3 & unemp_yearlaw!=., by (year)
generate sssse3 =sssset3/3
generate ssss3 = (sssseg3-unemp_yearlaw)/(sssse3-1)

egen sssseg4=sum(unemp_yearlaw) if  region==4 & unemp_yearlaw!=., by (year)
egen sssset4 = sum(region) if  region==4 & unemp_yearlaw!=., by (year)
generate sssse4 =sssset4/4
generate ssss4 = (sssseg4-unemp_yearlaw)/(sssse4-1)

egen sssseg5=sum(unemp_yearlaw) if  region==5 & unemp_yearlaw!=., by (year)
egen sssset5 = sum(region) if  region==5 & unemp_yearlaw!=., by (year)
generate sssse5 =sssset5/5
generate ssss5 = (sssseg5-unemp_yearlaw)/(sssse5-1)

egen sssseg6=sum(unemp_yearlaw) if  region==6 & unemp_yearlaw!=., by (year)
egen sssset6 = sum(region) if  region==6 & unemp_yearlaw!=., by (year)
generate sssse6 =sssset6/6
generate ssss6 = (sssseg6-unemp_yearlaw)/(sssse6-1)

egen sssseg7=sum(unemp_yearlaw) if  region==7 & unemp_yearlaw!=., by (year)
egen sssset7 = sum(region) if  region==7 & unemp_yearlaw!=., by (year)
generate sssse7 =sssset7/7
generate ssss7 = (sssseg7-unemp_yearlaw)/(sssse7-1)

egen sssseg8=sum(unemp_yearlaw) if  region==8 & unemp_yearlaw!=., by (year)
egen sssset8 = sum(region) if  region==8 & unemp_yearlaw!=., by (year)
generate sssse8 =sssset8/8
generate ssss8 = (sssseg8-unemp_yearlaw)/(sssse8-1)

generate region_unemp = ssss1
replace region_unemp = ssss2 if region_unemp==.
replace region_unemp = ssss3 if region_unemp==.
replace region_unemp = ssss4 if region_unemp==.
replace region_unemp = ssss5 if region_unemp==.
replace region_unemp = ssss6 if region_unemp==.
replace region_unemp = ssss7 if region_unemp==.
replace region_unemp = ssss8 if region_unemp==.


summarize s1 s2 s3 s4 s5 s6 s7 s8 region_unemp

**Second: Avg number of countries globally, excluding the country in question, that have unemp

egen glob5 =sum(unemp_yearlaw) if unemp_yearlaw!=., by (year)
generate dummysample5 = 1 if unemp_yearlaw!=.
egen globsamp5 =sum(dummysample5), by (year)
generate global_unemp = (glob5-unemp_yearlaw)/(globsamp5-1) 
summarize global_unemp globsamp5



***WORK INJURY 

egen ssssseg1=sum(working_yearlaw) if  region==1 & working_yearlaw!=., by (year)
egen ssssse1 = sum(region) if  region==1 & working_yearlaw!=., by (year)
generate sssss1 = (ssssseg1-working_yearlaw)/(ssssse1-1)

summarize sssss1, detail
summarize working_yearlaw if region==1, detail

egen ssssseg2=sum(working_yearlaw) if  region==2 & working_yearlaw!=., by (year)
egen ssssset2 = sum(region) if  region==2 & working_yearlaw!=., by (year)
generate ssssse2 =ssssset2/2
generate sssss2 = (ssssseg2-working_yearlaw)/(ssssse2-1)

egen ssssseg3=sum(working_yearlaw) if  region==3 & working_yearlaw!=., by (year)
egen ssssset3 = sum(region) if  region==3 & working_yearlaw!=., by (year)
generate ssssse3 =ssssset3/3
generate sssss3 = (ssssseg3-working_yearlaw)/(ssssse3-1)

egen ssssseg4=sum(working_yearlaw) if  region==4 & working_yearlaw!=., by (year)
egen ssssset4 = sum(region) if  region==4 & working_yearlaw!=., by (year)
generate ssssse4 =ssssset4/4
generate sssss4 = (ssssseg4-working_yearlaw)/(ssssse4-1)

egen ssssseg5=sum(working_yearlaw) if  region==5 & working_yearlaw!=., by (year)
egen ssssset5 = sum(region) if  region==5 & working_yearlaw!=., by (year)
generate ssssse5 =ssssset5/5
generate sssss5 = (ssssseg5-working_yearlaw)/(ssssse5-1)

egen ssssseg6=sum(working_yearlaw) if  region==6 & working_yearlaw!=., by (year)
egen ssssset6 = sum(region) if  region==6 & working_yearlaw!=., by (year)
generate ssssse6 =ssssset6/6
generate sssss6 = (ssssseg6-working_yearlaw)/(ssssse6-1)

egen ssssseg7=sum(working_yearlaw) if  region==7 & working_yearlaw!=., by (year)
egen ssssset7 = sum(region) if  region==7 & working_yearlaw!=., by (year)
generate ssssse7 =ssssset7/7
generate sssss7 = (ssssseg7-working_yearlaw)/(ssssse7-1)

egen ssssseg8=sum(working_yearlaw) if  region==8 & working_yearlaw!=., by (year)
egen ssssset8 = sum(region) if  region==8 & working_yearlaw!=., by (year)
generate ssssse8 =ssssset8/8
generate sssss8 = (ssssseg8-working_yearlaw)/(ssssse8-1)

generate region_working = sssss1
replace region_working = sssss2 if region_working==.
replace region_working = sssss3 if region_working==.
replace region_working = sssss4 if region_working==.
replace region_working = sssss5 if region_working==.
replace region_working = sssss6 if region_working==.
replace region_working = sssss7 if region_working==.
replace region_working = sssss8 if region_working==.


summarize sssss1 sssss2 sssss3 sssss4 sssss5 sssss6 sssss7 sssss8 region_working

**Second: Avg number of countries globally, excluding the country in question, that have work injury program

egen glob6 =sum(working_yearlaw) if working_yearlaw!=., by (year)
generate dummysample6 = 1 if working_yearlaw!=.
egen globsamp6 =sum(dummysample6), by (year)
generate global_working = (glob6-working_yearlaw)/(globsamp6-1) 
summarize global_working globsamp6


*****************************************
*****************************************
**** Figures and tables in the paper ****
*****************************************
*****************************************


** Figure 1 **

 gen dumautoldage =.
	  replace dumautoldage =1 if boix_regime==0 & oldage_yearlaw==1 & boix_regime!=.
	  
	  gen dumaut_total=.
	   replace dumaut_total =1 if boix_regime==0 & oldage_yearlaw!=. & boix_regime!=.
	
	
	
      gen dummdemos =.
	  replace dummdemos =1 if boix_regime==1 & oldage_yearlaw==1 & boix_regime!=.
	  
	 bysort year: egen dumm_sum_demos_old = sum(dummdemos) if dummdemos ==1 & boix_regime!=.
	 bysort year: egen dumm_sum_demos = sum(boix_regime) if boix_regime==1 & boix_regime!=.
	 bysort year: gen perc_demos_oldage =dumm_sum_demos_old/dumm_sum_demos 
	 
	 bysort year: egen dumm_sum_auth_old = sum(dumautoldage) if dumautoldage ==1 & boix_regime!=.
	 bysort year: egen dumm_sum_auth = sum(dumaut_total) if dumaut_total==1 & boix_regime!=.
	 bysort year: gen perc_auth_oldage =dumm_sum_auth_old/dumm_sum_auth
	
	 label var  perc_demos_oldage "Democracies"
	 label var  perc_auth_oldage "Autocracies"
	
		line perc_demos_oldage year if year>1900 & year<2000, title("Old-age Benefits") xtitle(Years) ///
	   ytitle("") xlabel(1900(20)2000) ylabel(0(.20)1) legend( symxsize(2))  scheme(s1mono) saving(oldage.gph, replace) || line perc_auth_oldage year if year>1900 & year<2000, lpattern("_")  

	   	   	 
		 ***MAT
	  gen dummdemos_mat =.
	  replace dummdemos_mat =1 if boix_regime==1 & mater_yearlaw==1 & boix_regime!=.
	  
	 bysort year: egen dumm_sum_demos_mat = sum(dummdemos_mat) if dummdemos_mat ==1  & boix_regime!=.
	 bysort year: gen perc_demos_mat =dumm_sum_demos_mat/dumm_sum_demos 
	
	
	
	  gen dumautotmat =.
	  replace dumautotmat =1 if boix_regime==0 & mater_yearlaw==1  & boix_regime!=.
	  
	  
	 bysort year: egen dumm_sum_auth_mat = sum(dumautotmat) if dumautotmat ==1  & boix_regime!=.
	 bysort year: gen perc_auth_mat =dumm_sum_auth_mat/dumm_sum_auth
	 
	 label var  perc_demos_mat "Democracies"
	 label var  perc_auth_mat "Autocracies"
	 
	 	line perc_demos_mat year if year>1900 & year<2000, title("Maternity Benefits") xtitle(Years) ///
	   ytitle("") xlabel(1900(20)2000) ylabel(0(.20)1) legend( symxsize(2))  scheme(s1mono) saving(mat.gph, replace) || line perc_auth_mat year if year>1900 & year<2000, lpattern("_")  

	   
	   *** sick
	   
	   
	   	  gen dummdemos_sick =.
	  replace dummdemos_sick =1 if boix_regime==1 & sick_yearlaw==1 & boix_regime!=.
	  
	 bysort year: egen dumm_sum_demos_sick = sum(dummdemos_sick) if dummdemos_sick ==1 & boix_regime!=.
	 bysort year: gen perc_demos_sick =dumm_sum_demos_sick/dumm_sum_demos
	
	
	
	  gen dumautotsick =.
	  replace dumautotsick =1 if boix_regime==0 & sick_yearlaw==1 & boix_regime!=.
	  
	  
	 bysort year: egen dumm_sum_auth_sick = sum(dumautotsick) if dumautotsick ==1 & boix_regime!=.
	 bysort year: gen perc_auth_sick =dumm_sum_auth_sick/dumm_sum_auth
	 
	 label var  perc_demos_sick "Democracies"
	 label var  perc_auth_sick "Autocracies"
	 
	 	line perc_demos_sick year if year>1900 & year<2000, title("Sickness Benefits") xtitle(Years) ///
	   ytitle("") xlabel(1900(20)2000) ylabel(0(.20)1) legend( symxsize(2)) scheme(s1mono) saving(sick.gph, replace) || line perc_auth_sick year if year>1900 & year<2000, lpattern("_")  

	
	**UNEM
	
	 	  gen dummdemos_unemp =.
	  replace dummdemos_unemp =1 if boix_regime==1 & unemp_yearlaw==1 & boix_regime!=.
	  
	 bysort year: egen dumm_sum_demos_unemp = sum(dummdemos_unemp) if dummdemos_unemp ==1 & boix_regime!=.
	 bysort year: gen perc_demos_unemp =dumm_sum_demos_unemp/dumm_sum_demos
	
	
	
	  gen dumautotunemp =.
	  replace dumautotunemp =1 if boix_regime==0 & unemp_yearlaw==1 & boix_regime!=.
	  
	  
	 bysort year: egen dumm_sum_auth_unemp = sum(dumautotunemp) if dumautotunemp ==1 & boix_regime!=.
	 bysort year: gen perc_auth_unemp =dumm_sum_auth_unemp/dumm_sum_auth
	 
	 label var  perc_demos_unemp "Democracies"
	 label var  perc_auth_unemp "Autocracies"
	 
	 	line perc_demos_unemp year if year>1900 & year<2000, title("Unemployment Benefits") xtitle(Years) ///
	   ytitle("") xlabel(1900(20)2000) ylabel(0(.20)1) legend( symxsize(2))  scheme(s1mono) saving(unemp.gph, replace) || line perc_auth_unemp year if year>1900 & year<2000 , lpattern("_") 

	**work*
	
	
	  	  gen dummdemos_work =.
	  replace dummdemos_work =1 if boix_regime==1 & working_yearlaw==1 & boix_regime!=.
	  
	 bysort year: egen dumm_sum_demos_work = sum(dummdemos_work) if dummdemos_work ==1 & boix_regime!=.
	 bysort year: gen perc_demos_work =dumm_sum_demos_work/dumm_sum_demos
	
	
	
	  gen dumautotwork =. 
	  replace dumautotwork =1 if boix_regime==0 & working_yearlaw==1 & boix_regime!=.
	  
	  
	 bysort year: egen dumm_sum_auth_work = sum(dumautotwork) if dumautotwork ==1 & boix_regime!=.
	 bysort year: gen perc_auth_work =dumm_sum_auth_work/dumm_sum_auth
	 
	 label var  perc_demos_work "Democracies"
	 label var  perc_auth_work "Autocracies"
	 
	 	line perc_demos_work year if year>1900 & year<2000, title("Accident Benefits") xtitle(Years) ///
	   ytitle("") xlabel(1900(20)2000) ylabel(0(.20)1) legend( symxsize(2))  scheme(s1mono) saving(work.gph, replace) || line perc_auth_work year if year>1900 & year<2000, lpattern("_") 

	   
	   *familiy_yearlaw
	   
	     gen dummdemos_fam =.
	  replace dummdemos_fam =1 if boix_regime==1 & familiy_yearlaw==1 & boix_regime!=.
	  
	 bysort year: egen dumm_sum_demos_fam = sum(dummdemos_fam) if dummdemos_fam ==1 & boix_regime!=.
	 bysort year: gen perc_demos_fam =dumm_sum_demos_fam/dumm_sum_demos
	
	
	
	  gen dumautotfam =.
	  replace dumautotfam =1 if boix_regime==0 & familiy_yearlaw==1 & boix_regime!=.
	  
	  
	 bysort year: egen dumm_sum_auth_fam = sum(dumautotfam) if dumautotfam ==1 & boix_regime!=.
	 bysort year: gen perc_auth_fam =dumm_sum_auth_fam/dumm_sum_auth
	 
	 label var  perc_demos_fam "Democracies"
	 label var  perc_auth_fam "Autocracies"
	 
	 line perc_demos_fam year if year>1900 & year<2000, title("Familiy Benefits") xtitle(Years) ///
	   ytitle("") xlabel(1900(20)2000) ylabel(0(.20)1) legend( symxsize(2)) scheme(s1mono) saving(fam.gph, replace) || line perc_auth_fam year if year>1900 & year<2000, lpattern("_")  

	   
	
	   graph combine oldage.gph mat.gph sick.gph work.gph unemp.gph fam.gph, scheme(s1mono)

sort Ccodecow year


** Table 1 **

logit oldage_yearlaw boix_regime loggdp i.year i.region, cluster(Ccodecow)
estimates store a1
logit oldage_yearlaw boix_regime loggdp i.year i.region lnpop EFI_long, cluster(Ccodecow)
estimates store a2
logit oldage_yearlaw boix_regime loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2, cluster(Ccodecow)
estimates store a3
logit introoldager boix_regime loggdp i.year i.region if lagoldage_yearlaw==0, cluster(Ccodecow)
estimates store a4
logit introoldager boix_regime loggdp i.year i.region lnpop EFI_long if lagoldage_yearlaw==0, cluster(Ccodecow)
estimates store a5
logit introoldager boix_regime loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 if lagoldage_yearlaw==0, cluster(Ccodecow)
estimates store a6
*ssc install estout
estout a1 a2 a3 a4 a5 a6, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) drop(1* 2*) rename(EFI_long Ethnic_fractionaliz. loggwfdur Ln_regime_duration gwf_military Military_regime gwf_monarchy Monarchy gwf_personal Personalist_regime gwf_other Other_autocracy loggdp Ln_GDP_p.c. year Time_trend yearb Time_trend lnpop Ln_Population urban Urbanization cow_milsize Size_of_military resdep2 Resource_Dependence global_fail Global_regime_failures region_fail Region_regime_failures) starlevels (* 0.10 ** 0.05 *** 0.01) stats (N)style (tex)


** Table 2 **

logit unemp_yearlaw boix_regime loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2, cluster(Ccodecow)
estimates store ua3
logit mater_yearlaw boix_regime loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2, cluster(Ccodecow)
estimates store ma3
logit familiy_yearlaw boix_regime loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2, cluster(Ccodecow)
estimates store fa3
logit working_yearlaw boix_regime loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2, cluster(Ccodecow)
estimates store wa3
logit sick_yearlaw boix_regime loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2, cluster(Ccodecow)
estimates store sa3
estout ua3 ma3 fa3 wa3 sa3 , cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) drop(1* 2*) rename(EFI_long Ethnic_fractionaliz. loggwfdur Ln_regime_duration gwf_military Military_regime gwf_monarchy Monarchy gwf_personal Personalist_regime gwf_other Other_autocracy loggdp Ln_GDP_p.c. year Time_trend yearb Time_trend lnpop Ln_Population urban Urbanization cow_milsize Size_of_military resdep2 Resource_Dependence global_fail Global_regime_failures region_fail Region_regime_failures) starlevels (* 0.10 ** 0.05 *** 0.01) stats (N)style (tex)


** Figure 2 **

graph box univers_oldageprog if univers_oldageprog>1.9999, yscale(range(2 9)) ylabel(#7) by(democracy)
**Further adjustments to colors, labels, etc, done with Grapheditor

sort Ccodecow year
** Table 3 **

xtreg univers_oldageprog boix_regime loggdp i.year if univers_oldageprog >1 & year>1888, fe cluster(Ccodecow)
estimates store u1
xtreg univers_oldageprog boix_regime loggdp lnpop urban cow_milsize resdep2 i.year if univers_oldageprog >1 & year>1888, fe cluster(Ccodecow)
estimates store u2
xtreg d.univers_oldageprog l.univers_oldageprog d.boix_regime l.boix_regime  d.loggdp  l.loggdp i.year if year>1888 & univers_oldageprog >1, fe cluster(Ccodecow)
estimates store u3
xtreg d.univers_oldageprog l.univers_oldageprog d.boix_regime l.boix_regime  d.loggdp  l.loggdp d.lnpop l.lnpop  d.urban l.urban d.cow_milsize l.cow_milsize d.resdep2 l.resdep2 i.year if year>1888 & univers_oldageprog >1, fe cluster(Ccodecow)
estimates store u4
xi: xtdpdsys univers_oldageprog boix_regime loggdp i.year if l.univers_oldageprog >1 & year>1888, lags(1)  maxldep(4)  maxlags(4) vce(robust) artests(2)
estimates store u5
xi: xtdpdsys univers_oldageprog boix_regime loggdp lnpop urban cow_milsize resdep2 i.year if l.univers_oldageprog >1 & year>1888, lags(1)  maxldep(4)  maxlags(4) vce(robust) artests(2)
estimates store u6
estout u1 u2 u3 u4 u5 u6, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) drop(1* 2* _I*) rename(EFI_long Ethnic_fractionaliz. loggwfdur Ln_regime_duration gwf_military Military_regime gwf_monarchy Monarchy gwf_personal Personalist_regime gwf_other Other_autocracy loggdp Ln_GDP_p.c. year Time_trend yearb Time_trend lnpop Ln_Population urban Urbanization cow_milsize Size_of_military resdep2 Resource_Dependence global_fail Global_regime_failures region_fail Region_regime_failures) starlevels (* 0.10 ** 0.05 *** 0.01) stats (N)style (tex)

**Additional result, re-estimating Model C1 only on obs entering Model C2
xtreg univers_oldageprog boix_regime loggdp i.year if univers_oldageprog >1 & year>1888& year>1888 &  _est_u2==1, fe cluster(Ccodecow)


** Figure 3 **

***Obtain correlations lags leads regime failure and pension existence/intro
correlate introoldager L12.gwf_fail L11.gwf_fail L10.gwf_fail L9.gwf_fail L8.gwf_fail L7.gwf_fail L6.gwf_fail L5.gwf_fail L4.gwf_fail L3.gwf_fail L2.gwf_fail L1.gwf_fail gwf_fail F1.gwf_fail F2.gwf_fail F3.gwf_fail F4.gwf_fail F5.gwf_fail F6.gwf_fail F7.gwf_fail F8.gwf_fail F9.gwf_fail F10.gwf_fail F11.gwf_fail F12.gwf_fail if L.oldage_yearlaw==0
** Thereafter paste results into excel spread-sheet (available on request), create 3-year moving averags which are plotted in Figure 3 (drawn in Excel).


** Table 4 **

*ssc install ivreg2
*ssc install xtivreg2
*ssc install ranktest 

version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 (oldage_yearlaw = region_pension) if wr_regtype !=., cluster(Ccodecow) first
estimates store t1
version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 loggwfdur (oldage_yearlaw = region_pension) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t2

***TEsting diagnostics with 2sls models
xtivreg2 gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 (oldage_yearlaw = region_pension) if wr_regtype !=., fe first cluster(Ccodecow)
xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 loggwfdur (oldage_yearlaw = region_pension) if wr_regtype !=., fe first  cluster(Ccodecow)

version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., cluster(Ccodecow) first
estimates store t3
version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 loggwfdur (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t4

xtivreg2 gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., fe first cluster(Ccodecow)
xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 loggwfdur (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., fe first  cluster(Ccodecow)

version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., cluster(Ccodecow) first
estimates store t5
version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail loggwfdur (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t6

xtivreg2 gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., fe first cluster(Ccodecow)
xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 loggwfdur global_fail region_fail (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., fe first  cluster(Ccodecow)

version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year i.region lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t7
xi: xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb i.region  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail  (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., fe first cluster(Ccodecow)

version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year i.region lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail  loggwfdur (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t8
xi: xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb i.region  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail  loggwfdur (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., fe first cluster(Ccodecow)

version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 (oldage_yearlaw = region_pension) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t9
xi: xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region  lnpop EFI_long urban cow_milsize resdep2 (oldage_yearlaw = region_pension) if wr_regtype !=., fe first cluster(Ccodecow)

version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 loggwfdur (oldage_yearlaw = region_pension) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t10
xi: xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region  lnpop EFI_long urban cow_milsize resdep2  loggwfdur (oldage_yearlaw = region_pension) if wr_regtype !=., fe first cluster(Ccodecow)

xi: xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb lnpop urban cow_milsize resdep2 global_fail region_fail (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., fe first cluster(Ccodecow) 
estimates store t11
xi: xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb lnpop urban cow_milsize resdep2 global_fail region_fail loggwfdur (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., fe first cluster(Ccodecow)
estimates store t12

estout t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01) stats (N)style (tex)


** Figure 4 **
***Generating predicted probabilities of regime failure from Model D1
version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 (oldage_yearlaw = region_pension) if wr_regtype !=., cluster(Ccodecow) first
estimates store t1
predict probregfailE1, pr

**Calculate estimated probabilities for average regime
margins, pred(pr) at((mean)_all oldage_yearlaw=(0 1))

**China 2000		 
margins, pred(pr) at(oldage_yearlaw=(0 1) gwf_military =(0) gwf_monarchy =(0) gwf_personal =(0) gwf_other =(0) loggdp=(8.2945) year=(2000) lnpop=( 14.06046)  EFI_long=(0.15379) urban=(35.78533)  cow_milsize = (0.21995) resdep2=(1.767332) region_pension=(1)) level(90)
**Argentina 1952
margins, pred(pr) at(oldage_yearlaw=(0 1) gwf_military =(0) gwf_monarchy =(0) gwf_personal =(1) gwf_other =(0) loggdp=(8.800) year=(1952) lnpop=(9.788)  EFI_long=(0.255) urban=(59.0283)  cow_milsize = (0.347845) resdep2=(0.4225) region_pension=(0.5789)) level(90)
**Italy 1922; NBNBNB Not part of the model, calculate mussolini italy in 1925 as single party
margins, pred(pr) at(oldage_yearlaw=(0 1) gwf_military =(0) gwf_monarchy =(0) gwf_personal =(0) gwf_other =(0) loggdp=(8.1613) year=(1925) lnpop=(10.58)  EFI_long=(0.1145) urban=(31.1)  cow_milsize = (0.76006) resdep2=(0.209) region_pension=(0.7368)) level(90)
*'Thailand 1973 and end of military regime with student uprisings and King intervening to put in place new regime, Thailand had no pension system then
margins, pred(pr) at(oldage_yearlaw=(0 1) gwf_military =(1) gwf_monarchy =(0) gwf_personal =(0) gwf_other =(0) loggdp=(7.5628) year=(1973) lnpop=(10.5889)  EFI_long=(0.6338) urban=(20.08)  cow_milsize = (0.58700) resdep2=(0.7316) region_pension=(0.714)) level(90)
**Then plot probability point estimates with 90 percent confidence intervals in excel spreadsheet to generate figure (available on request)



*********************************************
**************** APPENDIX *******************
*********************************************

*** Figure A1 ***

*** FIGURE A.1	   
	   
label var univers_oldageprog "Universalism Old-Age Benefits"
label var univers_mater_prog "Universalism Maternity Benefits"
label var univers_sick_prog "Universalism Sickness Benefits"
label var univers_working_prog "Universalism Accident Benefits"
label var univers_unemp_prog "Universalism Unemployment Benefits"
label var univers_familiy_prog "Universalism Familiy Benefits"



histogram univers_oldageprog if year>1900, percent scheme(s1mono) saving(old.gph, replace) ylab(0(10)60) 
histogram univers_mater_prog if year>1900, percent scheme(s1mono)  saving(mat.gph, replace) ytitle("") ylab(0(10)60) 
histogram univers_sick_prog if year>1900, percent scheme(s1mono) saving(sick.gph, replace) ytitle("") ylab(0(10)60) 
histogram univers_working_prog if year>1900, percent scheme(s1mono) saving(work.gph, replace) ylab(0(10)80) 
histogram univers_unemp_prog if year>1900, percent scheme(s1mono)saving(unemp.gph, replace) ytitle("")  ylab(0(10)80) 
histogram univers_familiy_prog if year>1900, percent scheme(s1mono) saving(famil.gph, replace) ytitle("")  ylab(0(10)80) 

graph combine old.gph mat.gph sick.gph work.gph unemp.gph famil.gph, scheme(s1mono)	saving(Figure_A_1_, replace)   
	   


*** Table A2 *** (descriptive statistics)
logit oldage_yearlaw boix_regime loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2, cluster(Ccodecow)
estimates store a3
summarize oldage_yearlaw boix_regime loggdp lnpop EFI_long urban cow_milsize resdep2 if _est_a3==1

*** Table A3 *** (alternative controls)
logit oldage_yearlaw boix_regime loggdp i.year i.region lnpop EFI_long urban cow_milsize Total_Resources_Income_PC, cluster(Ccodecow)
estimates store r1
logit oldage_yearlaw boix_regime loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 Civil_War, cluster(Ccodecow)
estimates store r2
logit oldage_yearlaw boix_regime loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 Britcolony, cluster(Ccodecow)
estimates store r3
logit oldage_yearlaw boix_regime loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 literacy, cluster(Ccodecow)
estimates store r4
logit oldage_yearlaw boix_regime loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 agro, cluster(Ccodecow)
estimates store r5
logit oldage_yearlaw boix_regime loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 totaltrade, cluster(Ccodecow)
estimates store r6
estout r1 r2 r3 r4 r5 r6, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01) stats (N)style (tex)


*** Table A4 *** (lag all indep variables by 1 year)
bysort Ccodecow: generate le1oldage_yearlaw = oldage_yearlaw[_n+1]
sort Ccodecow year
bysort Ccodecow: generate le1introoldager = oldage_yearlaw[_n+1]
sort Ccodecow year

logit le1oldage_yearlaw boix_regime loggdp i.year i.region, cluster(Ccodecow)
estimates store a1
logit le1oldage_yearlaw boix_regime loggdp i.year i.region lnpop EFI_long, cluster(Ccodecow)
estimates store a2
logit le1oldage_yearlaw boix_regime loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2, cluster(Ccodecow)
estimates store a3
logit le1introoldager boix_regime loggdp i.year i.region if lagoldage_yearlaw==0, cluster(Ccodecow)
estimates store a4
logit le1introoldager boix_regime loggdp i.year i.region lnpop EFI_long if lagoldage_yearlaw==0, cluster(Ccodecow)
estimates store a5
logit le1introoldager boix_regime loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 if lagoldage_yearlaw==0, cluster(Ccodecow)
estimates store a6

estout a1 a2 a3 a4 a5 a6, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01) stats (N)style (tex)


*** Table A5 *** (BCSTS + Carter & Signorino type tests)
sort Ccodecow year
generate nopension = . 
bysort Ccodecow:replace nopension =1 if oldage_yearlaw[_n-1]==0
sort Ccodecow year
bysort Ccodecow: generate cumnopension = sum(nopension) if oldage_yearlaw[_n-2]!=.
sort Ccodecow year
*bysort Ccodecow: replace cumnopension =. if cumnopension== cumnopension[_n-1]
*sort Ccodecow year
browse country year Ccodecow oldage_yearlaw introoldager nopension cumnopension
replace cumnopension=. if cumnopension==0
replace cumnopension=. if oldage_yearlaw==1 & introoldager==0
browse country year Ccodecow oldage_yearlaw introoldager nopension cumnopension
replace cumnopension = cumnopension+1
bysort Ccodecow:replace cumnopension =1 if cumnopension[_n+1]==2
browse country year Ccodecow oldage_yearlaw introoldager nopension cumnopension
generate cumnopensionsq = cumnopension^2
generate cumnopensioncu = cumnopension^3

logit introoldager boix_regime loggdp i.cumnopension i.region i.year if lagoldage_yearlaw==0, cluster(Ccodecow)
estimates store a1
logit introoldager boix_regime loggdp i.cumnopension i.region i.year lnpop EFI_long if lagoldage_yearlaw==0, cluster(Ccodecow)
estimates store a2
logit introoldager boix_regime loggdp i.cumnopension i.region lnpop i.year EFI_long urban cow_milsize resdep2 if lagoldage_yearlaw==0, cluster(Ccodecow)
estimates store a3
logit introoldager boix_regime loggdp cumnopension cumnopensionsq cumnopensioncu i.year i.region lnpop EFI_long if lagoldage_yearlaw==0, cluster(Ccodecow)
estimates store a5
logit introoldager boix_regime loggdp cumnopension cumnopensionsq cumnopensioncu i.year i.region lnpop EFI_long urban cow_milsize resdep2 if lagoldage_yearlaw==0, cluster(Ccodecow)
estimates store a6
logit introoldager boix_regime loggdp cumnopension cumnopensionsq cumnopensioncu yearx i.region if lagoldage_yearlaw==0, cluster(Ccodecow)
estimates store a4t
logit introoldager boix_regime loggdp cumnopension cumnopensionsq cumnopensioncu yearx i.region lnpop EFI_long if lagoldage_yearlaw==0, cluster(Ccodecow)
estimates store a5t
logit introoldager boix_regime loggdp cumnopension cumnopensionsq cumnopensioncu yearx i.region lnpop EFI_long urban cow_milsize resdep2 if lagoldage_yearlaw==0, cluster(Ccodecow)
estimates store a6t
estout a1 a2 a3 a5 a6 a4t a5t a6t, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01) stats (N)style (tex)


*** Table A6 *** (Polity2)

logit oldage_yearlaw polity_2 loggdp i.year i.region, cluster(Ccodecow)
estimates store a11
logit oldage_yearlaw polity_2 loggdp i.year i.region lnpop EFI_long, cluster(Ccodecow)
estimates store a21
logit oldage_yearlaw polity_2 loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2, cluster(Ccodecow)
estimates store a31
*Did not converge
*logit introoldager polity_2 loggdp i.year i.region if lagoldage_yearlaw==0, cluster(Ccodecow)
*estimates store a41
logit introoldager polity_2 loggdp i.year i.region lnpop EFI_long if lagoldage_yearlaw==0, cluster(Ccodecow)
estimates store a51
*Did not converge
*logit introoldager polity_2 loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 if lagoldage_yearlaw==0, cluster(Ccodecow)
*estimates store a61
estout a11 a21 a31 a51, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01) stats (N)style (tex)


*** Table A7 *** (Post-1946)
logit oldage_yearlaw boix_regime loggdp i.year i.region if year>1945, cluster(Ccodecow)
estimates store a11
logit oldage_yearlaw boix_regime loggdp i.year i.region lnpop EFI_long if year>1945, cluster(Ccodecow)
estimates store a21
logit oldage_yearlaw boix_regime loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 if year>1945, cluster(Ccodecow)
estimates store a31
logit introoldager boix_regime loggdp i.year i.region if lagoldage_yearlaw==0 & year>1945, cluster(Ccodecow)
estimates store a41
logit introoldager boix_regime loggdp i.year i.region lnpop EFI_long if lagoldage_yearlaw==0 & year>1945, cluster(Ccodecow)
estimates store a51
logit introoldager boix_regime loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 if lagoldage_yearlaw==0 & year>1945, cluster(Ccodecow)
estimates store a61
estout a11 a21 a31 a41 a51 a61, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01) stats (N)style (tex)



*** Table A8 *** (Controlling Communist legacy)

logit oldage_yearlaw boix_regime  comm loggdp i.year i.region, cluster(Ccodecow)
estimates store ca1
logit oldage_yearlaw boix_regime  comm loggdp i.year i.region lnpop EFI_long, cluster(Ccodecow)
estimates store ca2
logit oldage_yearlaw boix_regime  comm loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2, cluster(Ccodecow)
estimates store ca3
logit introoldager boix_regime  comm loggdp i.year i.region if lagoldage_yearlaw==0, cluster(Ccodecow)
estimates store ca4
logit introoldager boix_regime  comm loggdp i.year i.region lnpop EFI_long if lagoldage_yearlaw==0, cluster(Ccodecow)
estimates store ca5
logit introoldager boix_regime  comm loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 if lagoldage_yearlaw==0, cluster(Ccodecow)
estimates store ca6
estout ca1 ca2 ca3 ca4 ca5 ca6, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01) stats (N)style (tex)


*** Table A9 *** (Post-1946, D&D measure)

logit oldage_yearlaw chga_demo loggdp i.year i.region if year>1945, cluster(Ccodecow)
estimates store a11c
logit oldage_yearlaw chga_demo loggdp i.year i.region lnpop EFI_long if year>1945, cluster(Ccodecow)
estimates store a21c
logit oldage_yearlaw chga_demo loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 if year>1945, cluster(Ccodecow)
estimates store a31c
logit introoldager chga_demo loggdp i.year i.region if lagoldage_yearlaw==0 & year>1945, cluster(Ccodecow)
estimates store a41c
logit introoldager chga_demo loggdp i.year i.region lnpop EFI_long if lagoldage_yearlaw==0 & year>1945, cluster(Ccodecow)
estimates store a51c
logit introoldager chga_demo loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 if lagoldage_yearlaw==0 & year>1945, cluster(Ccodecow)
estimates store a61c
estout a11c a21c a31c a41c a51c a61c, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01) stats (N)style (tex)


*** Figure A3 *** 

bysort year: egen time_universalism_all =mean(universalism_all)if boix_regime!=.
bysort year: egen time_universalism_all_demos =mean(universalism_all)if boix_regime==1 & boix_regime!=.
bysort year: egen time_universalism_all_auth =mean(universalism_all)if boix_regime==0 & boix_regime!=.
label var time_universalism_all_demos "Universalism in Democracies"
label var time_universalism_all_auth "Universalism in Autocracies"
label var time_universalism_all "Universalism in All Regimes"


	 twoway line time_universalism_all_demos year if year>1900 & year<2000, title("") xtitle(Years) ///
	   ytitle("") xlabel(1900(20)2000)  scheme(s1mono) saving(Figure_A_2_, replace) ///
	  || line time_universalism_all_auth year if year>1900 & year<2000 || line time_universalism_all year if year>1900 & year<2000 


*** Table A10 *** (Universalism pension systems, extra specifications)

sort Ccodecow year
xtreg univers_oldageprog boix_regime loggdp i.year if univers_oldageprog >1 & year>1888, re cluster(Ccodecow) 
estimates store u1
xtreg univers_oldageprog boix_regime loggdp lnpop urban cow_milsize resdep2 i.year if univers_oldageprog >1 & year>1888, re cluster(Ccodecow)
estimates store u2
xtreg univers_oldageprog boix_regime loggdp i.year if univers_oldageprog >1 & year>1888, fe cluster(Ccodecow)
estimates store u3
xtreg univers_oldageprog boix_regime loggdp lnpop urban cow_milsize resdep2 i.year if univers_oldageprog >1 & year>1888, fe cluster(Ccodecow)
estimates store u4
xtreg d.univers_oldageprog l.univers_oldageprog d.boix_regime l.boix_regime  d.loggdp  l.loggdp i.year if year>1888 & univers_oldageprog >1, fe cluster(Ccodecow)
estimates store u5
xtreg d.univers_oldageprog l.univers_oldageprog d.boix_regime l.boix_regime  d.loggdp  l.loggdp d.lnpop l.lnpop  d.urban l.urban d.cow_milsize l.cow_milsize d.resdep2 l.resdep2 i.year if year>1888 & univers_oldageprog >1, fe cluster(Ccodecow)
estimates store u6
xi: xtdpdsys univers_oldageprog boix_regime loggdp i.year if l.univers_oldageprog >1 & year>1888, lags(1)  maxldep(4)  maxlags(4) vce(robust) artests(2)
estimates store u7
xi: xtdpdsys univers_oldageprog boix_regime loggdp lnpop urban cow_milsize resdep2 i.year if l.univers_oldageprog >1 & year>1888, lags(1)  maxldep(4)  maxlags(4) vce(robust) artests(2)
estimates store u8
xi: xtdpdsys univers_oldageprog  loggdp i.year if l.univers_oldageprog >1 & year>1888, lags(1)  maxldep(4)  maxlags(4) endog(boix_regime) vce(robust) artests(2)
estimates store u9
xi: xtdpdsys univers_oldageprog  loggdp lnpop urban cow_milsize resdep2 i.year if l.univers_oldageprog >1 & year>1888, lags(1)  maxldep(4)  maxlags(4) endog(boix_regime) vce(robust) artests(2)
estimates store u10

estout u1 u2 u3 u4 u5 u6 u7 u8 u9 u10, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01) stats (N)style (tex)


*** Table A11 *** (universalism other programs)

xtreg univers_mater_prog boix_regime loggdp i.year if univers_mater_prog >1 & year>1888, fe cluster(Ccodecow)
estimates store u1
xtreg univers_mater_prog  boix_regime loggdp lnpop urban cow_milsize resdep2 i.year if univers_mater_prog >1 & year>1888, fe cluster(Ccodecow)
estimates store u2
xtreg univers_sick_prog boix_regime loggdp i.year if univers_sick_prog >1 & year>1888, fe cluster(Ccodecow)
estimates store u3
xtreg univers_sick_prog boix_regime loggdp lnpop urban cow_milsize resdep2 i.year if univers_sick_prog >1 & year>1888, fe cluster(Ccodecow)
estimates store u4
xtreg univers_working_prog boix_regime loggdp i.year if univers_working_prog >1 & year>1888, fe cluster(Ccodecow)
estimates store u5
xtreg univers_working_prog boix_regime loggdp lnpop urban cow_milsize resdep2 i.year if univers_working_prog >1 & year>1888, fe cluster(Ccodecow)
estimates store u6
xtreg univers_unemp_prog boix_regime loggdp i.year if univers_unemp_prog >1 & year>1888, fe cluster(Ccodecow)
estimates store u7
xtreg univers_unemp_prog boix_regime loggdp lnpop urban cow_milsize resdep2 i.year if univers_unemp_prog >1 & year>1888, fe cluster(Ccodecow)
estimates store u8
xtreg univers_familiy_prog boix_regime loggdp i.year if univers_familiy_prog >1 & year>1888, fe cluster(Ccodecow)
estimates store u9
xtreg univers_familiy_prog boix_regime loggdp lnpop urban cow_milsize resdep2 i.year if univers_familiy_prog >1 & year>1888, fe cluster(Ccodecow)
estimates store u10

estout u1 u2 u3 u4 u5 u6 u7 u8 u9 u10, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) drop(1* 2*) rename(EFI_long Ethnic_fractionaliz. loggwfdur Ln_regime_duration gwf_military Military_regime gwf_monarchy Monarchy gwf_personal Personalist_regime gwf_other Other_autocracy loggdp Ln_GDP_p.c. year Time_trend yearb Time_trend lnpop Ln_Population urban Urbanization cow_milsize Size_of_military resdep2 Resource_Dependence global_fail Global_regime_failures region_fail Region_regime_failures) starlevels (* 0.10 ** 0.05 *** 0.01) stats (N)style (tex)


*** Table A12 *** (testing different cut-offs, universalism dummies)

logit univpension5  boix_regime loggdp i.year if year>1888 & univers_oldageprog >1, cluster(Ccodecow)
estimates store ol1
logit univpension5 boix_regime loggdp lnpop urban cow_milsize resdep2 i.year if year>1888 & univers_oldageprog >1, cluster(Ccodecow)
estimates store ol2

logit univpension6  boix_regime loggdp i.year if year>1888 & univers_oldageprog >1, cluster(Ccodecow)
estimates store ol3
logit univpension6 boix_regime loggdp lnpop urban cow_milsize resdep2 i.year if year>1888 & univers_oldageprog >1, cluster(Ccodecow)
estimates store ol4

logit univpension7  boix_regime loggdp i.year if year>1888 & univers_oldageprog >1, cluster(Ccodecow)
estimates store ol5
logit univpension7 boix_regime loggdp lnpop urban cow_milsize resdep2 i.year if year>1888 & univers_oldageprog >1, cluster(Ccodecow)
estimates store ol6

logit univpension8  boix_regime loggdp i.year if year>1888 & univers_oldageprog >1, cluster(Ccodecow)
estimates store ol7
logit univpension8 boix_regime loggdp lnpop urban cow_milsize resdep2 i.year if year>1888 & univers_oldageprog >1, cluster(Ccodecow)
estimates store ol8

logit univpension9  boix_regime loggdp i.year if year>1888 & univers_oldageprog >1, cluster(Ccodecow)
estimates store ol9
logit univpension9 boix_regime loggdp lnpop urban cow_milsize resdep2 i.year if year>1888 & univers_oldageprog >1, cluster(Ccodecow)
estimates store ol10
set matsize 2000
estout ol1 ol2 ol3 ol4 ol5 ol6 ol7 ol8 ol9 ol10, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) drop(1* 2*) rename(EFI_long Ethnic_fractionaliz. loggwfdur Ln_regime_duration gwf_military Military_regime gwf_monarchy Monarchy gwf_personal Personalist_regime gwf_other Other_autocracy loggdp Ln_GDP_p.c. year Time_trend yearb Time_trend lnpop Ln_Population urban Urbanization cow_milsize Size_of_military resdep2 Resource_Dependence global_fail Global_regime_failures region_fail Region_regime_failures) starlevels (* 0.10 ** 0.05 *** 0.01) stats (N)style (tex)


*** Table A13 *** (Ordinal logit and probit)

xtologit  univers_oldageprog boix_regime loggdp i.year if year>1888 & univers_oldageprog >1
estimates store ol5a
xtologit  univers_oldageprog boix_regime loggdp lnpop urban cow_milsize resdep2 i.year if year>1888 & univers_oldageprog >1
estimates store ol6a
xtoprobit univers_oldageprog boix_regime loggdp i.year if year>1888 & univers_oldageprog >1
estimates store ol7a
xtoprobit univers_oldageprog boix_regime loggdp lnpop urban cow_milsize resdep2 i.year if year>1888 & univers_oldageprog >1
estimates store ol8a
estout ol5a ol6a ol7a ol8a, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) drop(1* 2*) rename(EFI_long Ethnic_fractionaliz. loggwfdur Ln_regime_duration gwf_military Military_regime gwf_monarchy Monarchy gwf_personal Personalist_regime gwf_other Other_autocracy loggdp Ln_GDP_p.c. year Time_trend yearb Time_trend lnpop Ln_Population urban Urbanization cow_milsize Size_of_military resdep2 Resource_Dependence global_fail Global_regime_failures region_fail Region_regime_failures) starlevels (* 0.10 ** 0.05 *** 0.01) stats (N)style (tex)


*** Table A14 *** (Testing different lag-lengths)

bysort Ccodecow: generate le1univers_oldageprog = univers_oldageprog[_n+1]
sort Ccodecow year
bysort Ccodecow: generate le3univers_oldageprog = univers_oldageprog[_n+3]
sort Ccodecow year 
bysort Ccodecow: generate le5univers_oldageprog = univers_oldageprog[_n+5]
sort Ccodecow year


xtreg univers_oldageprog boix_regime loggdp i.year if univers_oldageprog >1 & year>1888, fe cluster(Ccodecow)
estimates store l1a
xtreg univers_oldageprog boix_regime loggdp lnpop urban cow_milsize resdep2 i.year if univers_oldageprog >1 & year>1888, fe cluster(Ccodecow)
estimates store l2a
xtreg le1univers_oldageprog boix_regime loggdp i.year if le1univers_oldageprog >1 & year>1888, fe cluster(Ccodecow)
estimates store l1
xtreg le1univers_oldageprog boix_regime loggdp lnpop urban cow_milsize resdep2 i.year if le1univers_oldageprog >1 & year>1888, fe cluster(Ccodecow)
estimates store l2
xtreg le3univers_oldageprog boix_regime loggdp i.year if le3univers_oldageprog >1 & year>1888, fe cluster(Ccodecow)
estimates store l3
xtreg le3univers_oldageprog boix_regime loggdp lnpop urban cow_milsize resdep2 i.year if le3univers_oldageprog >1 & year>1888, fe cluster(Ccodecow)
estimates store l4
xtreg le5univers_oldageprog boix_regime loggdp i.year if le5univers_oldageprog >1 & year>1888, fe cluster(Ccodecow)
estimates store l5
xtreg le5univers_oldageprog boix_regime loggdp lnpop urban cow_milsize resdep2 i.year if le5univers_oldageprog >1 & year>1888, fe cluster(Ccodecow)
estimates store l6

estout l1a l2a l1 l2 l3 l4 l5 l6, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) drop(1* 2*) rename(EFI_long Ethnic_fractionaliz. loggwfdur Ln_regime_duration gwf_military Military_regime gwf_monarchy Monarchy gwf_personal Personalist_regime gwf_other Other_autocracy loggdp Ln_GDP_p.c. year Time_trend yearb Time_trend lnpop Ln_Population urban Urbanization cow_milsize Size_of_military resdep2 Resource_Dependence global_fail Global_regime_failures region_fail Region_regime_failures) starlevels (* 0.10 ** 0.05 *** 0.01) stats (N)style (tex)



*** Table A15 *** (descriptive statistics)
version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., cluster(Ccodecow) first
estimates store t3

summarize gwf_fail oldage_yearlaw region_pension global_pension gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2   if _est_t3==1


*** Table A16 *** (logit and probit regime failure regressions)

logit gwf_fail oldage_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp year lnpop EFI_long urban cow_milsize resdep2 if wr_regtype !=., cluster(Ccodecow)
estimates store fq1
logit gwf_fail oldage_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp year lnpop EFI_long urban cow_milsize resdep2 loggwfdur if wr_regtype !=., cluster(Ccodecow)
estimates store fq2
logit gwf_fail oldage_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp year i.region lnpop EFI_long urban cow_milsize resdep2 if wr_regtype !=., cluster(Ccodecow)
estimates store fq3
logit gwf_fail oldage_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp year i.region lnpop EFI_long urban cow_milsize resdep2 loggwfdur if wr_regtype !=., cluster(Ccodecow)
estimates store fq4
logit gwf_fail oldage_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 if wr_regtype !=., cluster(Ccodecow)
estimates store fq5
logit gwf_fail oldage_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 loggwfdur if wr_regtype !=., cluster(Ccodecow)
estimates store fq6
probit gwf_fail oldage_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 if wr_regtype !=., cluster(Ccodecow)
estimates store fq7
probit gwf_fail oldage_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 loggwfdur if wr_regtype !=., cluster(Ccodecow)
estimates store fq8
probit gwf_fail oldage_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp year lnpop EFI_long urban cow_milsize resdep2 if wr_regtype !=., cluster(Ccodecow)
estimates store fq9
probit gwf_fail oldage_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp year lnpop EFI_long urban cow_milsize resdep2 loggwfdur if wr_regtype !=., cluster(Ccodecow)
estimates store fq10
probit gwf_fail oldage_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp year i.region lnpop EFI_long urban cow_milsize resdep2 if wr_regtype !=., cluster(Ccodecow)
estimates store fq11
probit gwf_fail oldage_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp year i.region lnpop EFI_long urban cow_milsize resdep2 loggwfdur if wr_regtype !=., cluster(Ccodecow)
estimates store fq12
estout fq1 fq2 fq3 fq4 fq5 fq6 fq9 fq10 fq11 fq12 fq7 fq8, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) drop(1* 2* 3* 4* 5* 6* 7* 8*) rename(EFI_long Ethnic_fractionaliz. loggwfdur Ln_regime_duration gwf_military Military_regime gwf_monarchy Monarchy gwf_personal Personalist_regime gwf_other Other_autocracy loggdp Ln_GDP_p.c. year Time_trend yearb Time_trend lnpop Ln_Population urban Urbanization cow_milsize Size_of_military resdep2 Resource_Dependence global_fail Global_regime_failures region_fail Region_regime_failures) starlevels (* 0.10 ** 0.05 *** 0.01) stats (N)style (tex)






*** Table A17 *** (logit and probit on regime failure with 5-yr lag)

logit f5.gwf_fail oldage_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp year lnpop EFI_long urban cow_milsize resdep2 if wr_regtype !=., cluster(Ccodecow)
estimates store fq1
logit f5.gwf_fail oldage_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp year lnpop EFI_long urban cow_milsize resdep2 loggwfdur if wr_regtype !=., cluster(Ccodecow)
estimates store fq2
logit f5.gwf_fail oldage_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp year i.region lnpop EFI_long urban cow_milsize resdep2 if wr_regtype !=., cluster(Ccodecow)
estimates store fq3
logit f5.gwf_fail oldage_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp year i.region lnpop EFI_long urban cow_milsize resdep2 loggwfdur if wr_regtype !=., cluster(Ccodecow)
estimates store fq4
logit f5.gwf_fail oldage_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 if wr_regtype !=., cluster(Ccodecow)
estimates store fq5
logit f5.gwf_fail oldage_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 loggwfdur if wr_regtype !=., cluster(Ccodecow)
estimates store fq6
probit f5.gwf_fail oldage_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 if wr_regtype !=., cluster(Ccodecow)
estimates store fq7
probit f5.gwf_fail oldage_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 loggwfdur if wr_regtype !=., cluster(Ccodecow)
estimates store fq8
probit f5.gwf_fail oldage_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp year lnpop EFI_long urban cow_milsize resdep2 if wr_regtype !=., cluster(Ccodecow)
estimates store fq9
probit f5.gwf_fail oldage_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp year lnpop EFI_long urban cow_milsize resdep2 loggwfdur if wr_regtype !=., cluster(Ccodecow)
estimates store fq10
probit f5.gwf_fail oldage_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp year i.region lnpop EFI_long urban cow_milsize resdep2 if wr_regtype !=., cluster(Ccodecow)
estimates store fq11
probit f5.gwf_fail oldage_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp year i.region lnpop EFI_long urban cow_milsize resdep2 loggwfdur if wr_regtype !=., cluster(Ccodecow)
estimates store fq12
estout fq1 fq2 fq3 fq4 fq5 fq6 fq9 fq10 fq11 fq12 fq7 fq8, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) drop(1* 2* 3* 4* 5* 6* 7* 8*) rename(EFI_long Ethnic_fractionaliz. loggwfdur Ln_regime_duration gwf_military Military_regime gwf_monarchy Monarchy gwf_personal Personalist_regime gwf_other Other_autocracy loggdp Ln_GDP_p.c. year Time_trend yearb Time_trend lnpop Ln_Population urban Urbanization cow_milsize Size_of_military resdep2 Resource_Dependence global_fail Global_regime_failures region_fail Region_regime_failures) starlevels (* 0.10 ** 0.05 *** 0.01) stats (N)style (tex)







*** Table A18 *** (logit and probit on old-age pensions with 5-yr lag)

logit f5.oldage_yearlaw gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year lnpop EFI_long urban cow_milsize resdep2 if wr_regtype !=., cluster(Ccodecow)
estimates store fq1
logit f5.oldage_yearlaw gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year lnpop EFI_long urban cow_milsize resdep2 loggwfdur if wr_regtype !=., cluster(Ccodecow)
estimates store fq2
logit f5.oldage_yearlaw gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year i.region lnpop EFI_long urban cow_milsize resdep2 if wr_regtype !=., cluster(Ccodecow)
estimates store fq3
logit f5.oldage_yearlaw gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year i.region lnpop EFI_long urban cow_milsize resdep2 loggwfdur if wr_regtype !=., cluster(Ccodecow)
estimates store fq4
logit f5.oldage_yearlaw gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 if wr_regtype !=., cluster(Ccodecow)
estimates store fq5
logit f5.oldage_yearlaw gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 loggwfdur if wr_regtype !=., cluster(Ccodecow)
estimates store fq6
probit f5.oldage_yearlaw gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 if wr_regtype !=., cluster(Ccodecow)
estimates store fq7
probit f5.oldage_yearlaw gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 loggwfdur if wr_regtype !=., cluster(Ccodecow)
estimates store fq8
probit f5.oldage_yearlaw gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year lnpop EFI_long urban cow_milsize resdep2 if wr_regtype !=., cluster(Ccodecow)
estimates store fq9
probit f5.oldage_yearlaw gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year lnpop EFI_long urban cow_milsize resdep2 loggwfdur if wr_regtype !=., cluster(Ccodecow)
estimates store fq10
probit f5.oldage_yearlaw gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year i.region lnpop EFI_long urban cow_milsize resdep2 if wr_regtype !=., cluster(Ccodecow)
estimates store fq11
probit f5.oldage_yearlaw gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year i.region lnpop EFI_long urban cow_milsize resdep2 loggwfdur if wr_regtype !=., cluster(Ccodecow)
estimates store fq12
estout fq1 fq2 fq3 fq4 fq5 fq6 fq9 fq10 fq11 fq12 fq7 fq8, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) drop(1* 2* 3* 4* 5* 6* 7* 8*) rename(EFI_long Ethnic_fractionaliz. loggwfdur Ln_regime_duration gwf_military Military_regime gwf_monarchy Monarchy gwf_personal Personalist_regime gwf_other Other_autocracy loggdp Ln_GDP_p.c. year Time_trend yearb Time_trend lnpop Ln_Population urban Urbanization cow_milsize Size_of_military resdep2 Resource_Dependence global_fail Global_regime_failures region_fail Region_regime_failures) starlevels (* 0.10 ** 0.05 *** 0.01) stats (N)style (tex)



*** Table A19 *** (first-stage IV regressions)

*Re-run Table 4 to get the first ten models in a table. The two last 2sls models need to be entered manually.

*** Table A20 *** (rob test, lag all indep variables by one year
bysort Ccodecow: generate le1gwf_fail = gwf_fail[_n+1]
sort Ccodecow year
bysort Ccodecow: generate le3gwf_fail = gwf_fail[_n+3]
sort Ccodecow year
bysort Ccodecow: generate le5gwf_fail = gwf_fail[_n+5]
sort Ccodecow year
version 13: ivprobit le1gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 (oldage_yearlaw = region_pension) if wr_regtype !=., cluster(Ccodecow) first
estimates store t1
version 13: ivprobit le1gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 loggwfdur (oldage_yearlaw = region_pension) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t2
version 13: ivprobit le1gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., cluster(Ccodecow) first
estimates store t3
version 13: ivprobit le1gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 loggwfdur (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t4
version 13: ivprobit le1gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., cluster(Ccodecow) first
estimates store t5
version 13: ivprobit le1gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail loggwfdur (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t6
version 13: ivprobit le1gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year i.region lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t7
version 13: ivprobit le1gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year i.region lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail  loggwfdur (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t8
version 13: ivprobit le1gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 (oldage_yearlaw = region_pension) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t9
version 13: ivprobit le1gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 loggwfdur (oldage_yearlaw = region_pension) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t10
xi: xtivreg2  le1gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb lnpop urban cow_milsize resdep2 global_fail region_fail (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., cluster(Ccodecow) fe first 
estimates store t11
xi: xtivreg2  le1gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb lnpop urban cow_milsize resdep2 global_fail region_fail loggwfdur (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., cluster(Ccodecow) fe first 
estimates store t12
estout t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) rename(EFI_long Ethnic_fractionaliz. loggwfdur Ln_regime_duration gwf_military Military_regime gwf_monarchy Monarchy gwf_personal Personalist_regime gwf_other Other_autocracy loggdp Ln_GDP_p.c. year Time_trend yearb Time_trend lnpop Ln_Population urban Urbanization cow_milsize Size_of_military resdep2 Resource_Dependence global_fail Global_regime_failures region_fail Region_regime_failures) starlevels (* 0.10 ** 0.05 *** 0.01) stats (N)style (tex)





*** Table A21 *** (maternity leave)

version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 (mater_yearlaw = region_mater) if wr_regtype !=., cluster(Ccodecow) first
estimates store t1
version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 loggwfdur (mater_yearlaw = region_mater) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t2
***TEsting diagnostics
xtivreg2 gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 (mater_yearlaw = region_mater) if wr_regtype !=., fe first
xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 loggwfdur (mater_yearlaw = region_mater) if wr_regtype !=., fe first 

version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 (mater_yearlaw = region_mater global_mater) if wr_regtype !=., cluster(Ccodecow) first
estimates store t3
version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 loggwfdur (mater_yearlaw = region_mater global_mater) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t4

xtivreg2 gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 (mater_yearlaw = region_mater global_mater) if wr_regtype !=., fe first
xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 loggwfdur (mater_yearlaw = region_mater global_mater) if wr_regtype !=., fe first 

version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail (mater_yearlaw = region_mater global_mater) if wr_regtype !=., cluster(Ccodecow) first
estimates store t5
version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail loggwfdur (mater_yearlaw = region_mater global_mater) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t6

xtivreg2 gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail (mater_yearlaw = region_mater global_mater) if wr_regtype !=., fe first
xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 loggwfdur global_fail region_fail (mater_yearlaw = region_mater global_mater) if wr_regtype !=., fe first 

version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year i.region lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail (mater_yearlaw = region_mater global_mater) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t7
xi: xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb i.region  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail  (mater_yearlaw = region_mater global_mater) if wr_regtype !=., fe first 
version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year i.region lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail  loggwfdur (mater_yearlaw = region_mater global_mater) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t8
xi: xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb i.region  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail  loggwfdur (mater_yearlaw = region_mater global_mater) if wr_regtype !=., fe first 

version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 (mater_yearlaw = region_mater) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t9
xi: xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region  lnpop EFI_long urban cow_milsize resdep2 (mater_yearlaw = region_mater) if wr_regtype !=., fe first 
version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 loggwfdur (mater_yearlaw = region_mater) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t10
xi: xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region  lnpop EFI_long urban cow_milsize resdep2  loggwfdur (mater_yearlaw = region_mater) if wr_regtype !=., fe first 

xi: xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb lnpop urban cow_milsize resdep2 global_fail region_fail (mater_yearlaw = region_mater global_mater) if wr_regtype !=., cluster(Ccodecow) fe first 
estimates store t11
xi: xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb lnpop urban cow_milsize resdep2 global_fail region_fail loggwfdur (mater_yearlaw = region_mater global_mater) if wr_regtype !=., cluster(Ccodecow) fe first 
estimates store t12

estout t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) drop(1* 2* 3* 4* 5* 6* 7* 8*) rename(EFI_long Ethnic_fractionaliz. loggwfdur Ln_regime_duration gwf_military Military_regime gwf_monarchy Monarchy gwf_personal Personalist_regime gwf_other Other_autocracy loggdp Ln_GDP_p.c. year Time_trend yearb Time_trend lnpop Ln_Population urban Urbanization cow_milsize Size_of_military resdep2 Resource_Dependence global_fail Global_regime_failures region_fail Region_regime_failures) starlevels (* 0.10 ** 0.05 *** 0.01) stats (N)style (tex)


*** Table A22 *** (family allowances)

version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 (familiy_yearlaw = region_familiy) if wr_regtype !=., cluster(Ccodecow) first
estimates store t1
version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 loggwfdur (familiy_yearlaw = region_familiy) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t2
***TEsting diagnostics
xtivreg2 gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 (familiy_yearlaw = region_familiy) if wr_regtype !=., fe first
xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 loggwfdur (familiy_yearlaw = region_familiy) if wr_regtype !=., fe first 

version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 (familiy_yearlaw = region_familiy global_familiy) if wr_regtype !=., cluster(Ccodecow) first
estimates store t3
version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 loggwfdur (familiy_yearlaw = region_familiy global_familiy) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t4

xtivreg2 gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 (familiy_yearlaw = region_familiy global_familiy) if wr_regtype !=., fe first
xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 loggwfdur (familiy_yearlaw = region_familiy global_familiy) if wr_regtype !=., fe first 

version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail (familiy_yearlaw = region_familiy global_familiy) if wr_regtype !=., cluster(Ccodecow) first
estimates store t5
version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail loggwfdur (familiy_yearlaw = region_familiy global_familiy) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t6

xtivreg2 gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail (familiy_yearlaw = region_familiy global_familiy) if wr_regtype !=., fe first
xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 loggwfdur global_fail region_fail (familiy_yearlaw = region_familiy global_familiy) if wr_regtype !=., fe first 

version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year i.region lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail (familiy_yearlaw = region_familiy global_familiy) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t7
xi: xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb i.region  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail  (familiy_yearlaw = region_familiy global_familiy) if wr_regtype !=., fe first 
version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year i.region lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail  loggwfdur (familiy_yearlaw = region_familiy global_familiy) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t8
xi: xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb i.region  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail  loggwfdur (familiy_yearlaw = region_familiy global_familiy) if wr_regtype !=., fe first 

version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 (familiy_yearlaw = region_familiy) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t9
xi: xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region  lnpop EFI_long urban cow_milsize resdep2 (familiy_yearlaw = region_familiy) if wr_regtype !=., fe first 
version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 loggwfdur (familiy_yearlaw = region_familiy) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t10
xi: xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region  lnpop EFI_long urban cow_milsize resdep2  loggwfdur (familiy_yearlaw = region_familiy) if wr_regtype !=., fe first 

xi: xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb lnpop urban cow_milsize resdep2 global_fail region_fail (familiy_yearlaw = region_familiy global_familiy) if wr_regtype !=., cluster(Ccodecow) fe first 
estimates store t11
xi: xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb lnpop urban cow_milsize resdep2 global_fail region_fail loggwfdur (familiy_yearlaw = region_familiy global_familiy) if wr_regtype !=., cluster(Ccodecow) fe first 
estimates store t12

estout t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) drop(1* 2* 3* 4* 5* 6* 7* 8*) rename(EFI_long Ethnic_fractionaliz. loggwfdur Ln_regime_duration gwf_military Military_regime gwf_monarchy Monarchy gwf_personal Personalist_regime gwf_other Other_autocracy loggdp Ln_GDP_p.c. year Time_trend yearb Time_trend lnpop Ln_Population urban Urbanization cow_milsize Size_of_military resdep2 Resource_Dependence global_fail Global_regime_failures region_fail Region_regime_failures) starlevels (* 0.10 ** 0.05 *** 0.01) stats (N)style (tex)


*** Table A23 *** (sickness benefits)

version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 (sick_yearlaw = region_sick) if wr_regtype !=., cluster(Ccodecow) first
estimates store t1
version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 loggwfdur (sick_yearlaw = region_sick) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t2
***TEsting diagnostics
xtivreg2 gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 (sick_yearlaw = region_sick) if wr_regtype !=., fe first
xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 loggwfdur (sick_yearlaw = region_sick) if wr_regtype !=., fe first 

version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 (sick_yearlaw = region_sick global_sick) if wr_regtype !=., cluster(Ccodecow) first
estimates store t3
version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 loggwfdur (sick_yearlaw = region_sick global_sick) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t4

xtivreg2 gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 (sick_yearlaw = region_sick global_sick) if wr_regtype !=., fe first
xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 loggwfdur (sick_yearlaw = region_sick global_sick) if wr_regtype !=., fe first 

version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail (sick_yearlaw = region_sick global_sick) if wr_regtype !=., cluster(Ccodecow) first
estimates store t5
version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail loggwfdur (sick_yearlaw = region_sick global_sick) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t6

xtivreg2 gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail (sick_yearlaw = region_sick global_sick) if wr_regtype !=., fe first
xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 loggwfdur global_fail region_fail (sick_yearlaw = region_sick global_sick) if wr_regtype !=., fe first 

version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year i.region lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail (sick_yearlaw = region_sick global_sick) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t7
xi: xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb i.region  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail  (sick_yearlaw = region_sick global_sick) if wr_regtype !=., fe first 
version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year i.region lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail  loggwfdur (sick_yearlaw = region_sick global_sick) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t8
xi: xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb i.region  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail  loggwfdur (sick_yearlaw = region_sick global_sick) if wr_regtype !=., fe first 

version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 (sick_yearlaw = region_sick) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t9
xi: xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region  lnpop EFI_long urban cow_milsize resdep2 (sick_yearlaw = region_sick) if wr_regtype !=., fe first 
version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 loggwfdur (sick_yearlaw = region_sick) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t10
xi: xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region  lnpop EFI_long urban cow_milsize resdep2  loggwfdur (sick_yearlaw = region_sick) if wr_regtype !=., fe first 

xi: xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb lnpop urban cow_milsize resdep2 global_fail region_fail (sick_yearlaw = region_sick global_sick) if wr_regtype !=., cluster(Ccodecow) fe first 
estimates store t11
xi: xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb lnpop urban cow_milsize resdep2 global_fail region_fail loggwfdur (sick_yearlaw = region_sick global_sick) if wr_regtype !=., cluster(Ccodecow) fe first 
estimates store t12

estout t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) drop(1* 2* 3* 4* 5* 6* 7* 8*) rename(EFI_long Ethnic_fractionaliz. loggwfdur Ln_regime_duration gwf_military Military_regime gwf_monarchy Monarchy gwf_personal Personalist_regime gwf_other Other_autocracy loggdp Ln_GDP_p.c. year Time_trend yearb Time_trend lnpop Ln_Population urban Urbanization cow_milsize Size_of_military resdep2 Resource_Dependence global_fail Global_regime_failures region_fail Region_regime_failures) starlevels (* 0.10 ** 0.05 *** 0.01) stats (N)style (tex)

*** Table A24 *** (unemployment)

version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 (unemp_yearlaw = region_unemp) if wr_regtype !=., cluster(Ccodecow) first
estimates store t1
version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 loggwfdur (unemp_yearlaw = region_unemp) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t2
***TEsting diagnostics
xtivreg2 gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 (unemp_yearlaw = region_unemp) if wr_regtype !=., fe first
xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 loggwfdur (unemp_yearlaw = region_unemp) if wr_regtype !=., fe first 

version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 (unemp_yearlaw = region_unemp global_unemp) if wr_regtype !=., cluster(Ccodecow) first
estimates store t3
version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 loggwfdur (unemp_yearlaw = region_unemp global_unemp) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t4

xtivreg2 gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 (unemp_yearlaw = region_unemp global_unemp) if wr_regtype !=., fe first
xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 loggwfdur (unemp_yearlaw = region_unemp global_unemp) if wr_regtype !=., fe first 

version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail (unemp_yearlaw = region_unemp global_unemp) if wr_regtype !=., cluster(Ccodecow) first
estimates store t5
version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail loggwfdur (unemp_yearlaw = region_unemp global_unemp) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t6

xtivreg2 gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail (unemp_yearlaw = region_unemp global_unemp) if wr_regtype !=., fe first
xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 loggwfdur global_fail region_fail (unemp_yearlaw = region_unemp global_unemp) if wr_regtype !=., fe first 

version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year i.region lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail (unemp_yearlaw = region_unemp global_unemp) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t7
xi: xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb i.region  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail  (unemp_yearlaw = region_unemp global_unemp) if wr_regtype !=., fe first 
*NOT CONVERGING
*version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year i.region lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail  loggwfdur (unemp_yearlaw = region_unemp global_unemp) if wr_regtype !=., cluster(Ccodecow) first 
*estimates store t8
*xi: xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb i.region  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail  loggwfdur (unemp_yearlaw = region_unemp global_unemp) if wr_regtype !=., fe first 

version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 (unemp_yearlaw = region_unemp) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t9
xi: xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region  lnpop EFI_long urban cow_milsize resdep2 (unemp_yearlaw = region_unemp) if wr_regtype !=., fe first 
version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 loggwfdur (unemp_yearlaw = region_unemp) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t10
xi: xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region  lnpop EFI_long urban cow_milsize resdep2  loggwfdur (unemp_yearlaw = region_unemp) if wr_regtype !=., fe first 

xi: xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb lnpop urban cow_milsize resdep2 global_fail region_fail (unemp_yearlaw = region_unemp global_unemp) if wr_regtype !=., cluster(Ccodecow) fe first 
estimates store t11
xi: xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb lnpop urban cow_milsize resdep2 global_fail region_fail loggwfdur (unemp_yearlaw = region_unemp global_unemp) if wr_regtype !=., cluster(Ccodecow) fe first 
estimates store t12

estout t1 t2 t3 t4 t5 t6 t7 t9 t10 t11 t12, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) drop(1* 2* 3* 4* 5* 6* 7* 8*) rename(EFI_long Ethnic_fractionaliz. loggwfdur Ln_regime_duration gwf_military Military_regime gwf_monarchy Monarchy gwf_personal Personalist_regime gwf_other Other_autocracy loggdp Ln_GDP_p.c. year Time_trend yearb Time_trend lnpop Ln_Population urban Urbanization cow_milsize Size_of_military resdep2 Resource_Dependence global_fail Global_regime_failures region_fail Region_regime_failures) starlevels (* 0.10 ** 0.05 *** 0.01) stats (N)style (tex)


*** Table A25 *** (work injury)
**Must use version 13 since 14 won't allow cluster
version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 (working_yearlaw = region_working) if wr_regtype !=., cluster(Ccodecow) first
estimates store t1
version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 loggwfdur (working_yearlaw = region_working) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t2
***TEsting diagnostics
xtivreg2 gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 (working_yearlaw = region_working) if wr_regtype !=., fe first
xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 loggwfdur (working_yearlaw = region_working) if wr_regtype !=., fe first 

version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 (working_yearlaw = region_working global_working) if wr_regtype !=., cluster(Ccodecow) first
estimates store t3
version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 loggwfdur (working_yearlaw = region_working global_working) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t4

xtivreg2 gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 (working_yearlaw = region_working global_working) if wr_regtype !=., fe first
xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 loggwfdur (working_yearlaw = region_working global_working) if wr_regtype !=., fe first 

version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail (working_yearlaw = region_working global_working) if wr_regtype !=., cluster(Ccodecow) first
estimates store t5
version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail loggwfdur (working_yearlaw = region_working global_working) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t6

xtivreg2 gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail (working_yearlaw = region_working global_working) if wr_regtype !=., fe first
xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 loggwfdur global_fail region_fail (working_yearlaw = region_working global_working) if wr_regtype !=., fe first 

version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year i.region lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail (working_yearlaw = region_working global_working) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t7
xi: xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb i.region  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail  (working_yearlaw = region_working global_working) if wr_regtype !=., fe first 
version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp year i.region lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail  loggwfdur (working_yearlaw = region_working global_working) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t8
xi: xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb i.region  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail  loggwfdur (working_yearlaw = region_working global_working) if wr_regtype !=., fe first 

version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 (working_yearlaw = region_working) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t9
xi: xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region  lnpop EFI_long urban cow_milsize resdep2 (working_yearlaw = region_working) if wr_regtype !=., fe first 
version 13: ivprobit gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 loggwfdur (working_yearlaw = region_working) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t10
xi: xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region  lnpop EFI_long urban cow_milsize resdep2  loggwfdur (working_yearlaw = region_working) if wr_regtype !=., fe first 

xi: xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb lnpop urban cow_milsize resdep2 global_fail region_fail (working_yearlaw = region_working global_working) if wr_regtype !=., cluster(Ccodecow) fe first 
estimates store t11
xi: xtivreg2  gwf_fail gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb lnpop urban cow_milsize resdep2 global_fail region_fail loggwfdur (working_yearlaw = region_working global_working) if wr_regtype !=., cluster(Ccodecow) fe first 
estimates store t12

estout t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) drop(1* 2* 3* 4* 5* 6* 7* 8*) rename(EFI_long Ethnic_fractionaliz. loggwfdur Ln_regime_duration gwf_military Military_regime gwf_monarchy Monarchy gwf_personal Personalist_regime gwf_other Other_autocracy loggdp Ln_GDP_p.c. year Time_trend yearb Time_trend lnpop Ln_Population urban Urbanization cow_milsize Size_of_military resdep2 Resource_Dependence global_fail Global_regime_failures region_fail Region_regime_failures) starlevels (* 0.10 ** 0.05 *** 0.01) stats (N)style (tex)


*** Table A26 *** (pensions endogenous, but control all other program types)

version 13: ivprobit gwf_fail mater_yearlaw sick_yearlaw unemp_yearlaw working_yearlaw familiy_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 (oldage_yearlaw = region_pension) if wr_regtype !=., cluster(Ccodecow) first
estimates store t1
version 13: ivprobit gwf_fail mater_yearlaw sick_yearlaw unemp_yearlaw working_yearlaw familiy_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 loggwfdur (oldage_yearlaw = region_pension) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t2
***TEsting diagnostics
xtivreg2 gwf_fail mater_yearlaw sick_yearlaw unemp_yearlaw working_yearlaw familiy_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 (oldage_yearlaw = region_pension) if wr_regtype !=., fe first
xtivreg2  gwf_fail mater_yearlaw sick_yearlaw unemp_yearlaw working_yearlaw familiy_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 loggwfdur (oldage_yearlaw = region_pension) if wr_regtype !=., fe first 

version 13: ivprobit gwf_fail mater_yearlaw sick_yearlaw unemp_yearlaw working_yearlaw familiy_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., cluster(Ccodecow) first
estimates store t3
version 13: ivprobit gwf_fail mater_yearlaw sick_yearlaw unemp_yearlaw working_yearlaw familiy_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 loggwfdur (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t4

xtivreg2 gwf_fail mater_yearlaw sick_yearlaw unemp_yearlaw working_yearlaw familiy_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., fe first
xtivreg2  gwf_fail mater_yearlaw sick_yearlaw unemp_yearlaw working_yearlaw familiy_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 loggwfdur (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., fe first 

version 13: ivprobit gwf_fail mater_yearlaw sick_yearlaw unemp_yearlaw working_yearlaw familiy_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., cluster(Ccodecow) first
estimates store t5
version 13: ivprobit gwf_fail mater_yearlaw sick_yearlaw unemp_yearlaw working_yearlaw familiy_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail loggwfdur (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t6

xtivreg2 gwf_fail mater_yearlaw sick_yearlaw unemp_yearlaw working_yearlaw familiy_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., fe first
xtivreg2  gwf_fail mater_yearlaw sick_yearlaw unemp_yearlaw working_yearlaw familiy_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 loggwfdur global_fail region_fail (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., fe first 

version 13: ivprobit gwf_fail mater_yearlaw sick_yearlaw unemp_yearlaw working_yearlaw familiy_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp year i.region lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t7
xi: xtivreg2  gwf_fail mater_yearlaw sick_yearlaw unemp_yearlaw working_yearlaw familiy_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb i.region  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail  (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., fe first 
version 13: ivprobit gwf_fail mater_yearlaw sick_yearlaw unemp_yearlaw working_yearlaw familiy_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp year i.region lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail  loggwfdur (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t8
xi: xtivreg2  gwf_fail mater_yearlaw sick_yearlaw unemp_yearlaw working_yearlaw familiy_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb i.region  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail  loggwfdur (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., fe first 

version 13: ivprobit gwf_fail mater_yearlaw sick_yearlaw unemp_yearlaw working_yearlaw familiy_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 (oldage_yearlaw = region_pension) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t9
xi: xtivreg2  gwf_fail mater_yearlaw sick_yearlaw unemp_yearlaw working_yearlaw familiy_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region  lnpop EFI_long urban cow_milsize resdep2 (oldage_yearlaw = region_pension) if wr_regtype !=., fe first 
version 13: ivprobit gwf_fail mater_yearlaw sick_yearlaw unemp_yearlaw working_yearlaw familiy_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 loggwfdur (oldage_yearlaw = region_pension) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t10
xi: xtivreg2  gwf_fail mater_yearlaw sick_yearlaw unemp_yearlaw working_yearlaw familiy_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region  lnpop EFI_long urban cow_milsize resdep2  loggwfdur (oldage_yearlaw = region_pension) if wr_regtype !=., fe first 

xi: xtivreg2  gwf_fail mater_yearlaw sick_yearlaw unemp_yearlaw working_yearlaw familiy_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb lnpop urban cow_milsize resdep2 global_fail region_fail (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., cluster(Ccodecow) fe first 
estimates store t11
xi: xtivreg2  gwf_fail mater_yearlaw sick_yearlaw unemp_yearlaw working_yearlaw familiy_yearlaw gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb lnpop urban cow_milsize resdep2 global_fail region_fail loggwfdur (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., cluster(Ccodecow) fe first 
estimates store t12

estout t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) drop(1* 2* 3* 4* 5* 6* 7* 8*) rename(EFI_long Ethnic_fractionaliz. loggwfdur Ln_regime_duration gwf_military Military_regime gwf_monarchy Monarchy gwf_personal Personalist_regime gwf_other Other_autocracy loggdp Ln_GDP_p.c. year Time_trend yearb Time_trend lnpop Ln_Population urban Urbanization cow_milsize Size_of_military resdep2 Resource_Dependence global_fail Global_regime_failures region_fail Region_regime_failures) starlevels (* 0.10 ** 0.05 *** 0.01) stats (N)style (tex)





*** Tables A27 (first-stage, two last models must be entered manually) and A28 (second stage ***


****Constructing TABLE for paper plus appx table, on democratization
version 13: ivprobit democratization_gwf gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 (oldage_yearlaw = region_pension) if wr_regtype !=., cluster(Ccodecow) first
estimates store t1d
version 13: ivprobit democratization_gwf gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 loggwfdur (oldage_yearlaw = region_pension) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t2d
***TEsting diagnostics
xtivreg2 democratization_gwf gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 (oldage_yearlaw = region_pension) if wr_regtype !=., fe first
xtivreg2  democratization_gwf gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 loggwfdur (oldage_yearlaw = region_pension) if wr_regtype !=., fe first 

version 13: ivprobit democratization_gwf gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., cluster(Ccodecow) first
estimates store t3d
version 13: ivprobit democratization_gwf gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 loggwfdur (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t4d

xtivreg2 democratization_gwf gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., fe first
xtivreg2  democratization_gwf gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 loggwfdur (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., fe first 

version 13: ivprobit democratization_gwf gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., cluster(Ccodecow) first
estimates store t5d
version 13: ivprobit democratization_gwf gwf_military gwf_monarchy gwf_personal gwf_other loggdp year  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail loggwfdur (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t6d

xtivreg2 democratization_gwf gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., fe first
xtivreg2  democratization_gwf gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 loggwfdur global_fail region_fail (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., fe first 

version 13: ivprobit democratization_gwf gwf_military gwf_monarchy gwf_personal gwf_other loggdp year i.region lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t7d
xi: xtivreg2  democratization_gwf gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb i.region  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail  (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., fe first 
version 13: ivprobit democratization_gwf gwf_military gwf_monarchy gwf_personal gwf_other loggdp year i.region lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail  loggwfdur (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t8d
xi: xtivreg2  democratization_gwf gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb i.region  lnpop EFI_long urban cow_milsize resdep2 global_fail region_fail  loggwfdur (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., fe first 

version 13: ivprobit democratization_gwf gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 (oldage_yearlaw = region_pension) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t9d
xi: xtivreg2  democratization_gwf gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region  lnpop EFI_long urban cow_milsize resdep2 (oldage_yearlaw = region_pension) if wr_regtype !=., fe first 
version 13: ivprobit democratization_gwf gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 loggwfdur (oldage_yearlaw = region_pension) if wr_regtype !=., cluster(Ccodecow) first 
estimates store t10d
xi: xtivreg2  democratization_gwf gwf_military gwf_monarchy gwf_personal gwf_other loggdp i.year i.region  lnpop EFI_long urban cow_milsize resdep2  loggwfdur (oldage_yearlaw = region_pension) if wr_regtype !=., fe first 

xi: xtivreg2  democratization_gwf gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb lnpop urban cow_milsize resdep2 global_fail region_fail (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., cluster(Ccodecow) fe first 
estimates store t11d
xi: xtivreg2  democratization_gwf gwf_military gwf_monarchy gwf_personal gwf_other loggdp yearb lnpop urban cow_milsize resdep2 global_fail region_fail loggwfdur (oldage_yearlaw = region_pension global_pension) if wr_regtype !=., cluster(Ccodecow) fe first 
estimates store t12d

estout t1d t2d t3d t4d t5d t6d t7d t8d t9d t10d t11d t12d, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) drop(1* 2* 3* 4* 5* 6* 7* 8*) rename(EFI_long Ethnic_fractionaliz. loggwfdur Ln_regime_duration gwf_military Military_regime gwf_monarchy Monarchy gwf_personal Personalist_regime gwf_other Other_autocracy loggdp Ln_GDP_p.c. year Time_trend yearb Time_trend lnpop Ln_Population urban Urbanization cow_milsize Size_of_military resdep2 Resource_Dependence global_fail Global_regime_failures region_fail Region_regime_failures) starlevels (* 0.10 ** 0.05 *** 0.01) stats (N)style (tex)


*** Table A29 *** (democratization using BMR)

version 13: ivprobit democratizationBMR loggdp year  lnpop EFI_long urban cow_milsize resdep2 (oldage_yearlaw = region_pension) if l.boix_regime ==0, cluster(Ccodecow) first
estimates store db1
xi: xtivreg2 democratizationBMR loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 (oldage_yearlaw = region_pension) if l.boix_regime ==0, fe first
version 13: ivprobit democratizationBMR loggdp year  lnpop EFI_long urban cow_milsize resdep2 (oldage_yearlaw = region_pension global_pension) if l.boix_regime ==0, cluster(Ccodecow) first
estimates store db2
xi: xtivreg2 democratizationBMR loggdp yearb  lnpop EFI_long urban cow_milsize resdep2 (oldage_yearlaw = region_pension global_pension) if l.boix_regime ==0, fe first
version 13: ivprobit democratizationBMR loggdp year i.region  lnpop EFI_long urban cow_milsize resdep2 (oldage_yearlaw = region_pension) if l.boix_regime ==0, cluster(Ccodecow) first
estimates store db3
xi: xtivreg2 democratizationBMR loggdp yearb i.region lnpop EFI_long urban cow_milsize resdep2 (oldage_yearlaw = region_pension) if l.boix_regime ==0, fe first

version 13: ivprobit democratizationBMR loggdp year i.region lnpop EFI_long urban cow_milsize resdep2 (oldage_yearlaw = region_pension global_pension) if l.boix_regime ==0, cluster(Ccodecow) first
estimates store db4
xi: xtivreg2 democratizationBMR loggdp yearb i.region lnpop EFI_long urban cow_milsize resdep2 (oldage_yearlaw = region_pension global_pension) if l.boix_regime ==0, fe first

version 13: ivprobit democratizationBMR loggdp i.year i.region  lnpop EFI_long urban cow_milsize resdep2 (oldage_yearlaw = region_pension) if l.boix_regime ==0, cluster(Ccodecow) first
estimates store db5
xi: xtivreg2 democratizationBMR loggdp i.year i.region lnpop EFI_long urban cow_milsize resdep2 (oldage_yearlaw = region_pension) if l.boix_regime ==0, fe first

estout db1 db2 db3 db4 db5, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01) stats (N)style (tex)

**
save "C:\Users\carlhk_adm\Dropbox\when labour gets what it whants\database\CPS_replication_Final.dta", replace
**

*********** END ************

